I'm new to AMQP and am trying to write a simple application that writes to the Qpid Java Broker with the Qpid Proton Messenger API. Out of the box the Qpid Java broker has four default exchanges (amq.match, amq.fanout, amq.topic, amq.direct), an AMQP "port" on port 5672 with a passwordFile auth povider. To take security out of the picture for this test I changed the auth provider to Anonymous.
For writing to the broker I am following this example. The example does not show how to write to a particular exchange or queue and I think my problem is somewhere in that domain. Here is my slimmed down version.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <Windows.h>
#include "proton\message.h"
#include "proton\messenger.h"
int main(int argc, const char* argv[])
{
while (true)
{
pn_message_t * message;
pn_messenger_t * messenger;
pn_data_t * body;
message = pn_message();
messenger = pn_messenger(NULL);
pn_messenger_start(messenger);
printf("set address result: %i\n", pn_message_set_address(message, "amqp://xxx.xxx.xxx.xxx:5672"));
body = pn_message_body(message);
char* msgtext = "howdy";
pn_data_put_string(body, pn_bytes(strlen(msgtext), msgtext));
pn_messenger_put(messenger, message);
printf("\nSent: %i\n", pn_messenger_send(messenger, 1));
pn_messenger_stop(messenger);
pn_messenger_free(messenger);
pn_message_free(message);
Sleep(10);
}
}
pn_messenger_send returns 0 (success). From the client machine I can see that the client is sending the messages over the wire. However in the broker management portal it shows zero client connections and the default virtual host shows 0 msg/s (0.00 B/s) inbound. I would expect this to show the bytes coming in from my test client. If I run the client with the broker down or point it to the wrong port the client will fail on the pn_messenger_send call so I know I am at least talking to the broker.
My question is where are these messages going? How do I define the exchange type and queue in my connection string for the message? I've searched and searched and haven't found anything. Any links to documentation or tutorials that I may have missed are welcome.
Here are some broker configuration screenshots for reference.
Thanks!