2

We are using NSB v6.4.3, NServiceBus.RabbitMQ v4.4.1, RabbitMQ.Client v5.0.1. My Queues are created automatically, but I received this error and soon as I send a message to my queue.

"title": "Channel has been closed: AMQP close-reason, initiated by Peer, code=404, text=\"NOT_FOUND - no exchange 'SelfDriving.NServicebus' in vhost '/'\", classId=60, methodId=40, cause=.", "detail": " at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at NServiceBus.MutateOutgoingTransportMessageBehavior.d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at NServiceBus.SerializeMessageConnector.d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at NServiceBus.MutateOutgoingMessageBehavior.d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at NServiceBus.UnicastSendRouterConnector.d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at SelfDriving.Api.Controllers.BasicController.d__19.MoveNext() in C:\Source\innovate\self_driving_ideas.cs\SelfDriving.Api\Controllers\BasicController.cs:line 61\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at SelfDriving.Api.Controllers.FiltersController.d__3.MoveNext() in C:\Source\innovate\self_driving_ideas.cs\SelfDriving.Api\Controllers\FiltersController.cs:line 188\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.GetResult()\r\n at SelfDriving.Api.Controllers.FiltersController.d__2.MoveNext() in C:\Source\innovate\self_driving_ideas.cs\SelfDriving.Api\Controllers\FiltersController.cs:line 168\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Threading.Tasks.TaskHelpersExtensions.d__3`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()", "code": "System.Exception"

I don't have any problem when I'm using MsmqTransport This is my configuration code

    config = new EndpointConfiguration("SelfDriving.NServiceBus");
config.AssemblyScanner();
config.UsePersistence<InMemoryPersistence>();
config.LimitMessageProcessingConcurrencyTo(1);
var recoverability = config.Recoverability();
recoverability.Immediate( customizations: immediate => { immediate.NumberOfRetries(3);});
DefaultFactory defaultFactory = LogManager.Use<DefaultFactory>();
defaultFactory.Directory("c:\storage\Bus");
defaultFactory.Level(LogLevel.Error);
config.SendFailedMessagesTo("error");
config.AuditProcessedMessagesTo("audit", TimeSpan.FromDays(7));
var rabbitMQTransport = config.UseTransport<RabbitMQTransport>().Transactions(TransportTransactionMode.ReceiveOnly);
var rabbitMQRouting = rabbitMQTransport.Routing();
rabbitMQRouting.RouteToEndpoint(assembly: Assembly.GetAssembly(typeof (BasicMessage)),destination: "SelfDriving.NServiceBus");
config.SendOnly();
var endpointInstance = Endpoint.Start(config).GetAwaiter().GetResult();
Fereshteh Rabet
  • 191
  • 2
  • 18

2 Answers2

3

This issue happened because RabbitMQ is case sensitive and I was sending it to SelfDriving.NServicebus which is a wrong end point instead of SelfDriving.NServicebus This issue resolved as soon as I change the endpoint name

Fereshteh Rabet
  • 191
  • 2
  • 18
  • (a) your answer helped me. but (b) the items you yellow highlighted, look like the same CaSe to me. (??) Can you add a note to your answer that says "notice the (third or fourth or fifth letter) of "X" that was a different case. – granadaCoder Aug 03 '20 at 14:23
0

You are configuring your endpoint as SendOnly. That means there's no incoming queue. But you also configure routing to send all messages inside the assembly in which BasicMessage is located to this exact same endpoint.

That's causing the issue no exchange 'SelfDriving.NServicebus'

If you remove the SendOnly option it'll probably work.

Dennis van der Stelt
  • 2,203
  • 16
  • 22
  • But I have no problem with sending and receiving messages when I'm using MsmqTransport. As soon as I removed the SendOnly part, I was not able to start the service bus. and I have this error: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text="NOT_FOUND - no queue 'SelfDriving.NServicebus' in vhost '/'", classId=60, methodId=20, cause= – Fereshteh Rabet Apr 11 '18 at 14:04