[rabbitmq-discuss] Best Practices: Exposing messages as "Envelope" (PHP PECL extension)

Pieter de Zwart pdezwart at rubiconproject.com
Mon Nov 28 21:30:26 GMT 2011


Hey everyone,

I want to run this up the flagpole and see who shoots it down. I am in the final stages of reworking the PHP AMQP extension for the v1.0 release. I was poking through the Java client, trying to steal as many of the good ideas in there as possible and I found the Envelope object, which is returned to a consumer on callback. The envelope is nice, but its lacking some basic things: properties and headers.

I am suggesting creating a new object for the PHP extension: AMQPEnvelope, which has the following signature:

// General getters
string getBody()
string getRoutingKey()
int getDeliveryTag()
string getExchange()
bool isRedelivery()

// Properties
string getContentType()
string getContentEncoding()
int getTimestamp()
int getPriority()
... list of all remaining properties except "headers" ...

// Headers
// Returns all headers as an array of key => value pairs
array getHeaders()
// Get a specific header identified by $headerName, and return (bool)false if it does not exist.
mixed getHeader($headerName)

I know the vast majority of people here are not PHP users, but I would love to hear about this in general as a broker client if this makes sense and sounds usable.


Thanks!
Pieter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20111128/e3aedbbd/attachment.htm>


More information about the rabbitmq-discuss mailing list