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

Simon MacMullen simon at rabbitmq.com
Wed Nov 30 11:07:20 GMT 2011


On 28/11/11 21:30, Pieter de Zwart wrote:

> 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.

Well the Envelope in the Java client is just trying to abstract away the 
commonality between the basic.get-ok and basic.deliver methods. Having 
said that, if I'd designed it I would have been tempted to stick the 
properties and the body in there too.

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

It's your library, but if it were me I'd pull the properties out into 
another class to more closely mimic AMQP. But I don't know if that's the 
PHP Way.

Cheers, Simon

-- 
Simon MacMullen
RabbitMQ, VMware


More information about the rabbitmq-discuss mailing list