Double-click the cMQConnectionFactory component to
display its Basic settings view in the
From the MQ Server list, select an MQ
server. In this use case, we use the default ActiveMQ server to handle the
In the Broker URI field, type in the URI of the message broker. Here we simply use the default URI "vm://localhost?broker.persistent=false".
In the message producer sub-route, double-click the cFile component to display its Basic
Define the properties of the cFile
In this use case, simply specify the path to the folder that holds the source file to be sent as electronic message, and leave the other parameters as they are.
Double-click the cJMS
component labeled Message_producer to display its
Basic settings view.
From the Type list, select queue to send the messages to a JMS queue.
In the Destination field, type in a name for the JMS queue,
"queue.hello"in this use case.Double-click the [...] button next to ConnectionFactory. Select the MQ connection factory that you have just configured in the dialog box and click OK.
Switch to the message consumer sub-route, and double click the
cJMS component labeled Message_consumer to display its Basic
- Configure the message consumer using exactly the same parameters as in the message producer.
Double-click the cProcessor
component to display its Basic settings
In the Code area, customize the code as
shown below to display the file names of the consumed messages on the
System.out.println("Message consumed: "+ exchange.getIn().getHeader("CamelFileName"));
- Press Ctrl+S to save your Routes.