0

I'm having some issues trying to figure out the solution for this problem: I need to implement a DLC on Apache Camel, though when message are dequeued from the dead letter queue I have on ActiveMQ, every single one of them has to be compared with the latest massage present on another AMQ queue.

So to be clear: when Camel is consuming from queue1 (dead letter queue) the message M1, before trying to resend it to a certain route, it has to compare M1 (for example header comparison) with the latest message present on queue2, M2. M2 is not to be removed from queue2 (it shall serve also for the next comparison) while M1 has to be removed from queue1.

I want to understand if this is possible and which EIP I'm missing in order to implement this.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Genaro Guida
  • 23
  • 1
  • 5

1 Answers1

0

What you need is a QueueBrowser to browse the messages of queue2 without consuming them.

Alternatively you could also consume from queue2 in a transaction and then force a rollback so that the message is not consumed. But when "latest message present on queue2" does not mean the first message, this will not work because you can only process the first message like this.

burki
  • 6,741
  • 1
  • 15
  • 31