[rabbitmq-discuss] how to set the message properties in rabbitmq 2.6.1?

Emile Joubert emile at rabbitmq.com
Mon Sep 19 13:08:06 BST 2011


Hi,

On 19/09/11 12:36, sam_mis wrote:
> Thanks for reply. previously I used Rabbitmq server 2.3 that support
> following way to set the message properties:
> 
> AMQP.BasicProperties msg=new AMQP.BasicProperties();
> msg.setxxxxx
> 
> method called and setXXX or getXXX  for the properties.can i do same for
> same here or used AMQP.BasicProperties.Builder class to build properties.

As you correctly point out, setters and getters have been replaced by
the builder pattern. This is a recent change, so not much documentation
exists at this point, but we intend to remedy that. In the meantime you
can refer to the javadoc:

http://www.rabbitmq.com/releases/rabbitmq-java-client/current-javadoc/com/rabbitmq/client/AMQP.BasicProperties.Builder.html

And most general information about the builder pattern should be
applicable, e.g. this article by Joshua Bloch:

http://drdobbs.com/java/208403883?pgno=2

Another source of information is the use of the builder pattern
throughout the examples and tests in the rabbit java client library, e.g.

com.rabbitmq.examples.PerQueueTTLPublisher



-Emile




More information about the rabbitmq-discuss mailing list