0

In the queue I have pushed 10K objects. Timestamp is one of the attribute in object. So, how can I write a consumer code using spring amqp?

can anyone help me on this.

Pand005
  • 1,095
  • 3
  • 23
  • 53

1 Answers1

2

AMQP, unlike JMS, has no notion of message selection for consumers. One solution is to use a topic exchange and set the routing key - let's say consumer 1 binds his queue to the exchange with foo.bar a second one binds with foo.baz; and a third binds with foo.*. The third will get all messages (with routing keys starting with foo.); the others will only get messages with their respective keys.

A direct exchange could also be used; it requires a complete match on the routing key.

You should probably work through all the RabbitMQ tutorials to understand the different exchange types before asking more questions here.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179