Hi all,<br><br>I'm using the Erlang client (2008/06/23 vintage, I think) and I've started to need message-related properties like timestamp, expiration, and so on, to avoid reinventing the wheel. The Java client's Javadoc I am not finding very helpful for this set of questions. I know that the Erlang client is still experimental, so I am
asking for "documentation" here (* see the end of this post before sending STFW messages, please :)<br><br>If the following questions are answered somewhere in a way that relates
to how to use it in the Erlang client (e.g. examples in Erlang), please point me to it and disregard the rest of these questions.<br><br>My questions are:<br><ol><li>When I send a message with properties set to amqp_util:basic_properties(), and receive it using a basic.get, the message has only got property data in properties_bin, but properties is set to 'none'. How do I decode what's in properties_bin? Alternatively, how do I get the properties to stay set in the unencoded 'properties' field?<br>
</li><li>What is the format of the timestamp field, and how do I encode/decode it? I can't find a definition for its type "timestamp" in the AMQP spec.<br></li><li>When and by what does the timestamp get set? I searched all the client code for 'timestamp' but could not find it, so when I create a new message, what sets this?</li>
<li>What is the format of the expiration? The spec does not define it.<br></li><li>What is the behavior when a message has expired? Does the client automatically throw it away when doing a basic.get or consume so I never see it?<br>
</li><li>Does the message_id ever get set automatically to a unique value?</li><li>What is the purpose of the 'type' property? The spec just writes "message type name"? Is this totally user-defined?</li>
<li>How does one set and get message headers?</li></ol>I am sure that I could work this all out if I read all the Rabbit code, all the AMQP tutorials I can find, and so on, but it would take me days. It's already taken hours so far. If anyone can help me shortcut this, I would be very grateful.<br>
<br>Regards,<br>
Edwin Fine<br>----------<br>* For those who believe I should RTFM or STFW, I hear you, and I have done my best in the time I have available. This is what I have done and/or learned:<br><br>I looked in the Erlang client and
server code, too, but found little to help, besides this in
amqp_util.erl:<br>
<br>
basic_properties() -><br>
#'P_basic'{content_type = <<"application/octet-stream">>, delivery_mode = 1, priority = 0}<br>
<br>
>From rabbit_framing.hrl, I got this:<br>
<br>
-record('P_basic', {content_type, content_encoding, headers,
delivery_mode, priority, correlation_id, reply_to, expiration,
message_id, timestamp, type, user_id, app_id, cluster_id}).<br>
<br>
The above fields are described in the amqp0-8.xml document in terms of
their basic type (e.g. shortstr, whatever that is) and their purpose.
The basic types (shortstr, timestamp, etc) are not explained in the
document, nor can I find a reference to anything that does explain
them. I saw in the Rabbit code an assertion that shortstr length must
be < 256, so now I know that :)<br>
<br>
In the Javadoc, only the content_type, delivery_mode, and priority
fields seem to be used in the MessageProperties class. The descriptions
of each of the properties in Basic.Properties are absent.<br>
<br>
I searched the Rabbit message list archives, too. One of the messages
pointed me to a tutorial in C, which was useful to see how some of the
properties were used (<a href="http://www.openamq.org/tutorial:soa">http://www.openamq.org/tutorial:soa</a>). Now I
understand that I have to set the message_id myself, and that the
routing key of the sender should be put into reply_to if the sender
requires a reply, in other words, the routing key of the responder must
be set to the sender's reply_to property.<br>
<br>I am still looking through the C code tutorials, so maybe I will find out more.<br>