Skip to content

Publish Message .NetCore #1096

Closed Answered by mookid8000
Mauro8k asked this question in Q&A
Jun 12, 2023 · 3 comments · 6 replies
Discussion options

You must be logged in to vote

When you await _bus.Send("message"); you must have configured a destination for messages of type System.String like this:

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 StringHandler could be something like this:

public class StringHandler : IHandleMessages<string>
{
    public async Task Handle(string message)
    {
        // .. ha…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@Mauro8k
Comment options

Comment options

You must be logged in to vote
1 reply
@Mauro8k
Comment options

Answer selected by Mauro8k
Comment options

You must be logged in to vote
4 replies
@Mauro8k
Comment options

@mookid8000
Comment options

@Mauro8k
Comment options

@mookid8000
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants