LibraryToggle FramesPrintFeedback

Example 5.2 shows an example of how to configure the Fuse Mediation Router's JMS component by defining a bean element with ID equal to jms. These settings are added to the Spring configuration file, camel-context.xml.


1

The CamelContext automatically instantiates any RouteBuilder classes that it finds in the specified Java package, org.apache.camel.example.spring.

2

The bean element with ID, jms, configures the JMS component. The bean ID corresponds to the component's URI prefix. For example, if a route specifies an endpoint with the URI, jms://MyQName, Fuse Mediation Router automatically loads the JMS component using the settings from the jms bean element.

3

JMS is just a wrapper for a messaging service. You must specify the concrete implementation of the messaging system by setting the connectionFactory property on the JmsComponent class.

4

In this example, the concrete implementation of the JMS messaging service is Apache ActiveMQ. The brokerURL property initializes a connection to an ActiveMQ broker instance, where the message broker is embedded in the local Java virtual machine (JVM). If a broker is not already present in the JVM, ActiveMQ will instantiate it with the options broker.persistent=false (the broker does not persist messages) and broker.useJmx=false (the broker does not open a JMX port).

Comments powered by Disqus