Hello,
I want to create really separated Publisher and subscriber. So no shared kernel with configuration and IoC modules and no shared dll with message contracts.
My plan, is to have doubled message definition (same type name, different namespace) but with same schema. This will lead to loosely coupled applications
It's seems that I'm not able to get this idea to work. Exchanges are created, but messages landing in _skipped queue. I'm using Autofac and RabbitMQ extensions. Here is configuration for Publisher:
builder.Register(c => Bus.Factory.CreateUsingRabbitMq(sbc =>
{
var queueConfig = c.Resolve<FoundationFSyncQueueConfiguration>();
var componentContext = c.Resolve<IComponentContext>();
sbc.Message<TotalImportedMessage>(x =>
{
x.SetEntityName("FoundationF:TotalImportedMessage");
});
var host = sbc.Host(new Uri(queueConfig.RabbitMqUri), h =>
{
h.Username(queueConfig.RabbitMqLogin);
h.Password(queueConfig.RabbitMqPassword);
});
}))
.As<IBus>()
.As<IBusControl>()
.SingleInstance();
FoundationF:TotalImportedMessage is used to have same exchange for different message types
Configuration for subscriber (different project, assembly for all files)
builder.RegisterConsumers(Assembly.Load("FoundationF.Application"));
builder.Register(c => Bus.Factory.CreateUsingRabbitMq(sbc =>
{
var queueConfig = c.Resolve<FoundationFSyncQueueConfiguration>();
var componentContext = c.Resolve<IComponentContext>();
sbc.Message<TotalImportedMessage>(x =>
{
x.SetEntityName("FoundationF:TotalImportedMessage");
});
var host = sbc.Host(new Uri(queueConfig.RabbitMqUri), h =>
{
h.Username(queueConfig.RabbitMqLogin);
h.Password(queueConfig.RabbitMqPassword);
});
sbc.ReceiveEndpoint(host, queueConfig.RabbitMqQueueName, e =>
{
e.LoadFrom(componentContext);
});
}))
.As<IBus>()
.As<IBusControl>()
.SingleInstance();
any ideas how to get this to work?