Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use "RegisterPublisher" for SendOnly enpoints in Azure Service Bus #26

Open
martinosk opened this issue Mar 20, 2020 · 3 comments

Comments

@martinosk
Copy link

I'm trying to migrate some subscribers to RabbitMQ, while publishers are still on Azure Service Bus.
This does not seem to work if the publisher is a SendOnly endpoint.
Following exception is thrown:
2020-03-20 15:25:31.109 ERROR ThrottlingRawEndpointConfig1[[NServiceBus.RabbitMQTransport, NServiceBus.Transport.RabbitMQ, Version=5.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c]] Error processing a message. Continuing in throttled mode. Microsoft.Azure.ServiceBus.MessagingEntityNotFoundException: Put token failed. status-code: 404, status-description: The messaging entity 'sb://testnamespaceiaoao.servicebus.windows.net/legacy-publisher' could not be found. To know more visit https://aka.ms/sbResourceMgrExceptions. TrackingId:732270da-9516-4813-bc61-3f1cbaa626c1_G5, SystemTracker:seabookdev.servicebus.windows.net:legacy-publisher, Timestamp:2020-03-20T14:25:32. at Microsoft.Azure.ServiceBus.Core.MessageSender.OnSendAsync(IList1 messageList)
at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func1 operation, TimeSpan operationTimeout) at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func1 operation, TimeSpan operationTimeout)
at Microsoft.Azure.ServiceBus.Core.MessageSender.SendAsync(IList1 messageList) at PostroutingTerminator.Terminate(PostroutingContext context) at NServiceBus.Router.ChainTerminator1.Invoke(T context, Func2 next) at NServiceBus.Router.TerminatorInvocationRule1.Invoke(T context, Func2 next) at NServiceBus.Router.Migrator.ShadowForwardSubscribeRule.Terminate(ForwardSubscribeContext context) at NServiceBus.Router.ChainTerminator1.Invoke(T context, Func2 next) at NServiceBus.Router.TerminatorInvocationRule1.Invoke(T context, Func2 next) at SubscribePreroutingTerminator.Terminate(SubscribePreroutingContext context) at NServiceBus.Router.ChainTerminator1.Invoke(T context, Func2 next) at NServiceBus.Router.TerminatorInvocationRule1.Invoke(T context, Func2 next) at PreroutingToSubscribePreroutingFork.Invoke(PreroutingContext context, Func2 next)
at ThrottlingRawEndpointConfig`1.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at NServiceBus.Transport.RabbitMQ.MessagePump.Process(BasicDeliverEventArgs message)

@SzymonPobiega
Copy link
Owner

Hey

The exception you see means that there is no queue legacy-publisher publisher on the azure side. Not sure what is this message and why it is about to be sent to the publisher. Can you include your router configuration code and the Router.Connector configuration from your subscriber?

@martinosk
Copy link
Author

            var routing = endpointConfig.EnableTransportMigration<AzureServiceBusTransport, RabbitMQTransport>(
                asb =>
                {
                    asb.ConnectionString(asbConnString);                    
                    asb.Transactions(TransportTransactionMode.ReceiveOnly);
                },
                rmq =>
                {
                    rmq.ConnectionString("UserName=guest;Password=guest;host=localhost;");
                    rmq.UseConventionalRoutingTopology();
                });

            routing.RegisterPublisher(typeof(DummyEvent), "maosk-legacy-publisher");

@SzymonPobiega
Copy link
Owner

Ah, that unfortunately won't work. The transport migration tool currently only works between transports that use message-driven pub/sub (MSMQ, SQL Server 4, ASQ) and transports that have native pub/sub support.

In your case you need to use the regular Router APIs and set up a router between ASB and RabbitMQ as a separate thing. You can still host it in the same process as one of you endpoints.

Take a look at this sample https://docs.particular.net/samples/router/mixed-transports/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants