Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation to work with Activemq Artemis #286

Open
AndreSteenbergen opened this issue Jul 18, 2018 · 1 comment
Open

Documentation to work with Activemq Artemis #286

AndreSteenbergen opened this issue Jul 18, 2018 · 1 comment
Labels
Info Useful information

Comments

@AndreSteenbergen
Copy link

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();
        }
    }
@xinchen10 xinchen10 added the Info Useful information label Jul 20, 2018
@michaelandrepearce
Copy link

Hi

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.

You can find details here
https://activemq.apache.org/components/nms/providers/amqp/

Or look at nuget and search Apache.NMS.AMQP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Info Useful information
Projects
None yet
Development

No branches or pull requests

3 participants