We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

pravin prajapati • 1 year ago

How to define queue name in multicast routing, right now its generating random name for queue.
https://uploads.disquscdn.c...

Vinicius Bassi • 2 years ago

Hello! Im having trouble trying to understand the BookCache class that you inject in the consumer. Do you have a code sample that you can share?

Havret • 2 years ago
gabi pantiru • 2 years ago

Hello, is it possible to pass a RecoveryPolicy or to disable the automatic recovery when I register the service?
If the Artemis server is not available when application try to start then the application doesn't start. Thank you

Havret • 2 years ago

Yes it is. Please take a look here and here.

Alex Nasyr • 3 years ago

hi. many thanx for this article.
can you explain how to implement typed message producer from IProducer? please

Havret • 3 years ago

Alex Nasyr
This should be as simple as:

public class MessageProducer
{
private readonly IProducer _producer;

public MessageProducer(IProducer producer)
{
_producer = producer;
}

public async Task PublishAsync<t>(T message)
{
var serialized = JsonSerializer.Serialize(message);
var msg = new Message(serialized);
await _producer.SendAsync(msg);
}
}

And then you have to register it as follows:

services.AddActiveMq("bookstore-cluster", new[] { Endpoint.Create(host: "localhost", port: 5672, "guest", "guest") })
.AddProducer<messageproducer>("my-address");

Just be mindful that while IAnonymousProducer can send messages to different addresses, IProducer is restricted to a single address.

I hope that answers your question.

Alex Nasyr • 3 years ago

thanx for your answer.))) it was the main problem - i try to operate with "address" inside of MessageProduser