You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The standard HelloWorld sample works in multiple Amqp 1.0 brokers, I had some issues using Activemq Artemis. It was caused by artemis standard auto-creation feature. all-defaults it will create topics. When you want to work with queues you need to specify it in either broker.xml, or you can set it using Capabilities, see below. Might be good to document how to work with different brokers.
public class SimpleAmqpTest
{
[Fact]
public async Task TestHelloWorld()
{
Address address = new Address("amqp://guest:guest@localhost:5672");
Connection connection = await Connection.Factory.CreateAsync(address);
Session session = new Session(connection);
Message message = new Message("Hello AMQP");
Target target = new Target
{
Address = "q1",
Capabilities = new Symbol[] { new Symbol("queue") }
};
SenderLink sender = new SenderLink(session, "sender-link", target, null);
await sender.SendAsync(message);
Source source = new Source
{
Address = "q1",
Capabilities = new Symbol[] { new Symbol("queue") }
};
ReceiverLink receiver = new ReceiverLink(session, "receiver-link", source, null);
message = await receiver.ReceiveAsync();
receiver.Accept(message);
await sender.CloseAsync();
await receiver.CloseAsync();
await session.CloseAsync();
await connection.CloseAsync();
}
}
The text was updated successfully, but these errors were encountered:
The Apache ActiveMQ team have just released their official supported .net client (under the hood it uses this lib) thats been tested with both 5.x and Artemis brokers. Being amqp also works with other amqp 1.0 brokers e.g. tested with Solace also.
The standard HelloWorld sample works in multiple Amqp 1.0 brokers, I had some issues using Activemq Artemis. It was caused by artemis standard auto-creation feature. all-defaults it will create topics. When you want to work with queues you need to specify it in either broker.xml, or you can set it using Capabilities, see below. Might be good to document how to work with different brokers.
The text was updated successfully, but these errors were encountered: