[rabbitmq-discuss] Erlang client and properties
Ben Hood
0x6e6562 at gmail.com
Sat Nov 8 01:43:16 GMT 2008
Edwin,
On Fri, Nov 7, 2008 at 10:31 PM, Edwin Fine
<rabbitmq-discuss_efine at usa.net> wrote:
>(* see the end of this
> post before sending STFW messages, please :)
What about RTFS :-)
> 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.
As you pointed out yourself, the Erlang client is still experimental,
though it is getting better the more attention we give it.
Having said that, it does require some TLC wrt properties and flags,
so don't treat it as gospel.
Also, remember that it attempts to re-use as much code from the server
as it can - which is cool OTOH.....but originally, the server was not
decided with this in mind. So we may need to refactor some stuff
there, e.g. decoded properties vs. binary properties - for persistent
messages, the binary version is written to the journal, not the
decoded version. You would not have this in a client side only
construct.
> 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?
See answers above. Also - amqp_util is bit rotten and probably needs
cleaning up.
> 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.
> 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?
> What is the format of the expiration? The spec does not define it.
> 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?
> Does the message_id ever get set automatically to a unique value?
> What is the purpose of the 'type' property? The spec just writes "message
> type name"? Is this totally user-defined?
I'll let Matthias answer these questions as he is reviewing the
upcoming 0.9.1 spec.
> How does one set and get message headers?
Create your own P_basic tuple and set all of the fields appropriately.
> 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.
You are quite rightfully identifying many ambiguities in the protocol
definition, which for good reason is not yet 1.0 (because it is
buggy).
You should try to implement an AMQP compliant broker one of these
days, as you have been able to gather from your initial investigation,
the protocol is still some off being conceptually sound.
Also, you must appreciate that RabbitMQ is not the official source of
the AMQP spec - this has been authored by the AMQP working group.
However, in the absence of any public forums for AMQP where
individuals can express their views, I think it is perfectly valid for
the community to use the Rabbit mailing list to discuss these issues.
After all, these are the real people using the protocol.
HTH,
Ben
More information about the rabbitmq-discuss
mailing list