Closed valeriob closed 5 years ago
Hey @valeriob
You're missing the subscription store registration as shown in https://docs.particular.net/samples/router/mixed-transports/#code-walk-through-router: EnableMessageDrivenPublishSubscribe()
Unfortunately for now the exception message is really horrible as it does not point you in any direction. I'll be working on making it better soon.
Hi Szymon, sorry but i pasted the wrong "main", this is the code of the bridge i'm using, EnableMessageDrivenPublishSubscribe() it's present :
static async Task Main()
{
Console.Title = "Samples.Router.MixedTransports.Router";
var routerConfig = new RouterConfiguration("Samples.Router.MixedTransports.Router");
var msmqInterface = routerConfig.AddInterface<MsmqTransport>("MSMQ", t => { });
msmqInterface.EnableMessageDrivenPublishSubscribe(new InMemorySubscriptionStorage());
var cs = "Data Source=localhost\\SQLEXPRESS;Initial Catalog=NSBTest;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False";
var rabbitMQInterface = routerConfig.AddInterface<SqlServerTransport>("RabbitMQ", t =>
{
t.ConnectionString(cs);
});
var staticRouting = routerConfig.UseStaticRoutingProtocol();
staticRouting.AddForwardRoute("MSMQ", "RabbitMQ");
routerConfig.AutoCreateQueues();
var router = Router.Create(routerConfig);
await router.Start().ConfigureAwait(false);
Console.WriteLine("Press <enter> to exit");
Console.ReadLine();
await router.Stop().ConfigureAwait(false);
}
@valeriob have you tied the trick with EnableMessageDrivenPublishSubscribe
above ☝️
Yes EnableMessageDrivenPublishSubscribe it's already set in msmqInterface
@valeriob you need to enable it in both as SQL Server also does not support native pub/sub. They can refer to the same subscription table.
Thanks @SzymonPobiega that worked ! But now i'm getting this exception, i'm having hard time to understand what's appening :
That looks like attempting to send a message with SQL server transport address to MSMQ
Hi, i'm trying to learn how the router works, so i took this sample https://docs.particular.net/samples/router/mixed-transports/ and tring to switch rabbitmq with SqlServer :
The exception is
What am i missing ? Thanks in advance.