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

Rob Harrop rob at rabbitmq.com
Thu Nov 11 09:56:01 GMT 2010


To set the BasicProperties, you simply create an instance of AMQP.BasicProperties and then pass it into the basicPublish method:

AMQP.BasicProperties props = new AMQP.BasicProperties();
props.setDeliveryMode(2);
channel.basicPublish(exchange, routingKey, props, message.getBytes());

Hope this helps,

Rob

On 11 Nov 2010, at 06:50, sam_mis wrote:

> 
> Hi all
> 
> i am using Rabbitmq Java client API.i want to set the Basic Properties of
> message and also get the message Id of the message.if possible please
> provide some code to understand the things.
> 
> Thanks
> 
> -- 
> View this message in context: http://old.nabble.com/how-to-set-the-basic-message-properties-for-message-in-rabbitmq--tp30187552p30187552.html
> Sent from the RabbitMQ mailing list archive at Nabble.com.
> 
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss



More information about the rabbitmq-discuss mailing list