[rabbitmq-discuss] Java Client :how can i uniquely identify a message?

Rob Harrop rob at rabbitmq.com
Thu Nov 11 10:12:02 GMT 2010


On 11 Nov 2010, at 07:08, sam_mis wrote:

> 
> I have Created a RabbitMQ Producer and a RabbitMQ Consumer....
> 
> suppose my producer produces 10 messages. How can i get a particular message
> from those 10 messages.

You can't pick a particular message to retrieve from the queue, you must consume messages in the order they were added to the queue.

> 
> I want to know how can i uniquely identify a message and read that or
> consume that message.

You can use the message ID property (BasicProperties.{set, get}MessageId) to add your own identifier to messages as you send them.

What do you want to do with the messages that you don't choose to process? Is there a way you could route messages more effectively on the send side?

> -- 
> View this message in context: http://old.nabble.com/Java-Client-%3Ahow-can-i-uniquely-identify-a-message--tp30187626p30187626.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