Publish Message .NetCore #1096
-
Hi
But this is the erro the RabbitMq show me : WebApp could not be dispatched to any handlers (and will not be retried under the default fail-fast settings)) rebus. the most curios thing is when I tested the same code logic con configurations but using the Nuget rebus.ServiceProvider 7.0.0 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
The error message
means that a message has been received from a queue, but Rebus was unable to find an appropriate handler for the message. EITHER you're missing a handler registration, e.g. like services.AddRebusHandler<SomeMessageHandler>(); OR you have sent the message to the wrong queue. If you tell me exactly how you sent the message (e.g. was it |
Beta Was this translation helpful? Give feedback.
-
When you services.AddRebus(
configure => configure
.(...)
.Routing(t => t.TypeBased().Map<string>("some-queue"))
); which will cause the message to be sent to the queue named "some-queue". Now you'll just have to be sure that the Rebus instance that has "some-queue" as its input queue has an appropriate message handler registered, e.g. like this: services.AddRebusHandler<StringHandler>(); where public class StringHandler : IHandleMessages<string>
{
public async Task Handle(string message)
{
// .. handle message in here
}
} |
Beta Was this translation helpful? Give feedback.
-
Ok, cool! 🙂 But just to be sure (because this is a mistake that I've often seen people make when they start out with Rebus): Your two projects each have their own input queue, right? Because if you let two Rebus instances share the same input queue, only one of them will get each message, and it will result in the same error message from time to time. |
Beta Was this translation helpful? Give feedback.
When you
await _bus.Send("message");
you must have configured a destination for messages of typeSystem.String
like this:which will cause the message to be sent to the queue named "some-queue". Now you'll just have to be sure that the Rebus instance that has "some-queue" as its input queue has an appropriate message handler registered, e.g. like this:
where
StringHandler
could be something like this: