[rabbitmq-discuss] Newbie - using rabbitmq-c

Mike Aubury mike at aubit.com
Fri Jun 8 14:19:50 BST 2012


Hi, sorry for such a simple question...
I had written some interface code in C using openAMQ - but I've now
realised that looks like its been canned - so I'm looking at porting to
something else...

I can get my head around putting stuff into the exchanges/queues etc*
*(amq_basic_publish)
from this code :


  char *messagebody="Hello World";
  ...
    amqp_basic_properties_t props;
    props._flags = AMQP_BASIC_CONTENT_TYPE_FLAG |
AMQP_BASIC_DELIVERY_MODE_FLAG;
    props.content_type = amqp_cstring_bytes("text/plain");
    props.delivery_mode = 2; /* persistent delivery mode */
    die_on_error(amqp_basic_publish(conn,
                                    1,
                                    amqp_cstring_bytes(exchange),
                                    amqp_cstring_bytes(routingkey),
                                    0,
                                    0,
                                    &props,
                                    amqp_cstring_bytes(messagebody)),
                 "Publishing");


but pulling data off is escaping me atm..

Whats the **simplest way** of getting that data, as a full string I can
then process ?
(All the examples seem to do strange things with frames/frame headers etc)
..

Ideally - I want to replace my existing :

#define BUFFSIZE 10000
 char message_text[BUFFSIZE];

 content = amq_client_session_basic_arrived (session);
 message_size = amq_content_basic_get_body (content,
                                             (byte *)
                                             message_text,
                                             sizeof (message_text));



and - so far I've only got as far as :

   #define BUFFSIZE 10000
   char message_text[BUFFSIZE];

   amqp_simple_wait_frame(conn, &frame);


;)



Any help, or pointers to some documentation would be much appreciated !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120608/e430ddbe/attachment.htm>


More information about the rabbitmq-discuss mailing list