How to change the OriginalDestination header on the ActiveMQ message

Solution Verified - Updated -

Environment

  • JBoss Fuse 6.1

Issue

I would like to change the OriginalDestination header on the ActiveMQ message in Camel. How can I do it?

Resolution

You can use the following code in the Camel processor to modify the OriginalDestination header:

  JmsMessage jmsMessage = exchange.getIn(JmsMessage.class);
  ActiveMQMessage amqMessage = getJmsMessage.getJmsMessage();
  ActiveMQDestination destination = ...;
  amqMessage.setOriginalDestination(destination);

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.