![]() In this case, we set new values in our captured header collection to be added to the sent message. The only use case that breaks is if we need to "switch" between tenants and user identities in mid-flight. Transfering the consume context headers already takes care of the vast majority of my cases where I just want internal headers propagated along with every sent/published message. The somewhat crappy solution I'm settling on is to test if the IServiceProvider is part of the payload before attempting to append extra headers. Ensure the type is concrete and services are registered for all parameters of a public constructor. ![]() System.InvalidOperationException: Error while validating the service descriptor 'ServiceType: `1 Lifetime: Transient ImplementationType: ': A suitable constructor for type '' could not be located. Is this possible or am I barking up the wrong tree?īeta Was this translation helpful? Give feedback. Id much prefer this to manually configuring filters on every single consumer definition (using the definitions only for configuration specific to that message type). We can wrap up all of our filters and register them once, which saves us a lot of management pain when dealing with multiple micro-services that all depend on the same set of platform features. Scoped filters had the added benefit of allowing us apply a stack of "global" filters to all send/publish/consume pipelines. UseInMemoryOutbox() īefore this change, we used to just resolve the IServiceProvider from the context payload and resolve the dependencies inline - basically reverting to a service locator pattern to fetch dependencies as needed in the filters. How do I apply this in a consumer definition? // endpointConfigurator.UseMessageScope( ? ) endpointConfigurator. IConsumerConfigurator consumerConfigurator)ĮndpointConfigurator. IReceiveEndpointConfigurator endpointConfigurator, Protected override void ConfigureConsumer( ![]() Public class CreateAccountConsumerDefinition Is there a way to configure that with Mass Transit ?Īctually I have 12 * 5 = 60 exchanges created by Mass Transit, and I require only one exchange to avoid polluting the RabbitMq cluster with useless exchanges.īeta Was this translation helpful? Give feedback.Customer_worker_1 | System.ArgumentException: The scoped filter must implement GreenPipes.IFilter> (Parameter 'scopedType')Ĭustomer_worker_1 | at .AddScopedFilter(IPipeConfigurator`1 configurator, Type scopedType, IServiceProvider provider)Ĭustomer_worker_1 | at .MessageSpecificationCreated(IMessagePublishPipeSpecification`1 specification)Ĭustomer_worker_1 | at _Displa圜lass0_0`1.b_0(IPublishPipeSpecificationObserver observer)Ĭustomer_worker_1 | at `1.All(Func`2 callback)Ĭustomer_worker_1 | at (IMessagePublishPipeSpecification`1 specification)Ĭustomer_worker_1 | at (Type type)Ĭustomer_worker_1 | at `2.GetOrAdd(TKey key, Func`2 valueFactory)Ĭustomer_worker_1 | at ()Ĭustomer_worker_1 | at (IMessagePublishPipeSpecification`1 specification)Ĭustomer_worker_1 | at .b_4_0(Type x)Ĭustomer_worker_1 | at .(PublishContext`1 context)Ĭustomer_worker_1 | at .Send(SendContext`1 context)Ĭustomer_worker_1 | at `1.Send(SendContext`1 context)Ĭustomer_worker_1 | at .SendPipe`1.Send(ModelContext modelContext)Ĭustomer_worker_1 | at `1.(IPipe`1 pipe, CancellationToken cancellationToken)Ĭustomer_worker_1 | at (Boolean concurrentMessageDelivery)Ĭustomer_worker_1 | at `2.Send(TContext context, IPipe`1 next)Ĭustomer_worker_1 | at `1.(TContext context, IPipe`1 next)įor completeness sake, here's what my startup and consumer definitions look like: I need to create one single exchange for my service (direct type exchange), for all consumers, and determine in which queue the message is sent according to the routing key. Is it possible to configure MassTransit that way ? ![]() I do not want to pollute the the rabbitMq Cluster with all these types of exchange, I just need only one single exchange. So there are 3*4 = 12 consumers implemented in my services.įor each consumer, 6 exchanges are created: The service consumes 4 types of objects, and for rach Type, there are 3 types of action: create, update, delete. I plan to implement it a first service, for message consuming purpose. I am trying to integrate MassTransit to transfer messages from services to services through a rabbitMq shared cluster.
0 Comments
Leave a Reply. |