[openamq-dev] Complied the program on command prompt
Pieter Hintjens
ph at imatix.com
Wed Aug 8 16:08:14 CEST 2007
Mousami,
> When receive exe is run it gives assertion failure on statement
> assert(content); which means no content is received.
Your test programs aren't right. I assume you've attached different
files from the ones you are actually testing. (receive.txt does not
have a line 182, where the assertion is happening.)
What I suggest is you read carefully amq_client.c, which publishes and
consumes messages.
You should also read this page
http://wiki.openamq.org/package:chatroom-example and the attached
examples, which are written in PAL (the test scripting language).
PAL is good for understanding AMQP because it's very compact. For
example, this is the PAL script to send messages to a chat channel:
?xml?>
<pal script = "amq_pal_gen">
This script implements a simple chat client. Run this in one window,
and im_read in a second window. Usage: im_send -C channel -U username
<session>
<set name = "channel" cmdline = "C" value = "default" />
<set name = "username" cmdline = "U" value = "guest" />
<exchange_declare type = "fanout" exchange = "$channel" />
<repeat>
<read name = "data" prompt = ">" />
<if name = "data" test = "eq" value = "quit">
<break/>
</if>
<basic_content>$username: $data</basic_content>
<basic_publish exchange = "$channel" />
</repeat>
</session>
</pal>
Look at the generated C code, and you'll see how each command, e.g.
<basic publish> is expressed as C.
-Pieter
More information about the openamq-dev
mailing list