
Contents 1ħ CHAPTER 1 What is MassTransit? MassTransit is a free, open source, lightweight message bus for creating distributed applications using the.net framework. Message-based communication is a reliable and scalable way to implement a service oriented architecture. MassTransit provides an extensive set of features on top existing message transports, resulting in a developer friendly way to asynchronously connect services using message-based conversation patterns.

Unfortunately when I try to send a message from the publisher side and I monitor the ObjectAddedIntegrationEvent direct exchange I see nothing coming.5 MassTransit is a free, open source, lightweight message bus for creating distributed applications using the.net framework. Also the ObjectAddedHandlerTenant fanout exchange (which should be the matching exchange) is created correctly. When the consumer is started the ObjectAddedIntegrationEvent direct exchange is created correctly. Rabbit.Bind("ObjectAddedIntegrationEvent", s =>

If (endpointConfigurator is IRabbitMqReceiveEndpointConfigurator rabbit) IConsumerConfigurator consumerConfigurator) Protected override void ConfigureConsumer(IReceiveEndpointConfigurator endpointConfigurator, Public ObjectAddedHandlerConsumerDefinition(IConfigurationProvider provider)ĮndpointName = "ObjectAddedHandler" + provider.TenantName Private readonly IConfigurationProvider _provider Internal class ObjectAddedHandler : IConsumerĪwait class ObjectAddedHandlerConsumerDefinition : X.AddConsumer().Endpoint(e => e.Name = "ObjectAddedHandler "+configurationProvider.TenantName) Receiver side: container.AddMassTransit(x => String hostnames = ("RabbitMQNodes").Split(' ') HostConfigurator.Password(("RabbitMQPassword")) HostConfigurator.Username(("RabbitMQUsername")) Var host = cfg.Host(("RabbitMQHostName"), hostConfigurator => RoutingCfg.UseRoutingKeyFormatter(config => ("TenantCode")) Ĭfg.Message(routingCfg => routingCfg.SetEntityName("ObjectAddedIntegrationEvent")) Ĭfg.Publish(routingCfg => routingCfg.ExchangeType = ExchangeType.Direct) Publisher side: container.AddMassTransit(x => However I would like to set my endpoints to accept messages only with routing key tenantName. When I try to access the endpoint in adding the consumer I can only modify the name, the prefetch count and a couple of more properties but nothing more.

#MASSTRANSIT CONNECTCONSUMER HOW TO#
Couldn't find anywhere in the documentation how to add the consumer in the way I do and at the same time setting the binding properties of the endpoint as reported in the documentation. However by following the documentation I would like to setup a direct exchange in order to use routing keys. *HERE*/ x.AddConsumer().Endpoint(e => e.Name = "ObjectAddedHandler "+configurationProvider.TenantName) ().Endpoint.AddressFamily = AddressFamily.InterNetwork HostConfigurator.Password(configurationProvider.RabbitMQPassword) HostConfigurator.Username(configurationProvider.RabbitMQUsername) Var host = cfg.Host(configurationProvider.RabbitMQHostName, hostConfigurator =>

Public async Task Consume(ConsumeContext context)Īwait is registered in my container through: container.AddMassTransit(x => I am having the following consumer type: internal class ObjectAddedHandler : IConsumer
