1

I am trying to set up a simple example to connect to and send a message to a queue. we removed authentication for qpid so as to not need a username and password. what happens is once it tries to send the message I get an AMQP exception with the message amqp:connection:forced

what does this exception mean? and any idea of what I might have missed?

        string broker = "amqp://linuxlab.netigrate.net:5672";
        string outQueue = "toVCC";
        string inQueue = "fromVCC";

        Connection.DisableServerCertValidation = true;

        Connection connection = null;

        try
        {
            Address address = new Address(broker);
            connection = new Connection(address);
            Session session = new Session(connection);

            SenderLink sender = new SenderLink(session, "sendAndRecieve.send", outQueue);

            Message message = new Message("Hello");

            sender.Send(message);

2 Answers2

0

From the AMQP 1.0 spec on the amqp:connection:forced error code:

An operator intervened to close the connection for some reason. The client could retry at some later date. 

So the remote side is telling your client it cannot connect.

I'd check the logs on the broker side to see if there is some meaningful error information on connect.

Tim Bish
  • 17,475
  • 4
  • 32
  • 42
0

This error typically shows up when there is an AMQP version mismatch. In your case Amqp.Net Lite uses only version AMQP 1.0 and the Qpidd broker is probably running only version AMQP 0-10. One way to get a hint is to SET QPID_LOG_ENABLE=trace+ in your environment before you execute the broker. The trace should expose the mismatch.

To get Qpidd broker to use AMQP 1.0 you can use either of two methods:

  • Load the AMQP 1.0 library explicitly with --load-module amqp.dll (or amqp.so on linux systems).
  • Direct the broker to load all modules with --module-dir somepath where the path is the name of folder that holds the amqp.dll (or .so) file.

If you are building Qpidd from sources you also need to build the qpid-proton project in order to provide AMQP 1.0 support.

Chug
  • 71
  • 5
  • Thank you very much, I've been butting my head against the wall for days about this problem. it is solved now :) –  Oct 22 '15 at 13:38