Message Dispatcher

Camel supports the Message Dispatcher from the EIP patterns using various approaches.

You can use a component like JMS with selectors to implement a Selective Consumer as the Message Dispatcher implementation. Or you can use an Endpoint as the Message Dispatcher itself and then use a Content Based Router as the Message Dispatcher.



The following example demonstrates Message Dispatcher pattern using the Competing Consumers functionality of the JMS component to offload messages to a Content Based Router and custom Processors registered in the Camel Registry running in separate threads from originating consumer.


Using the Fluent Builders



Using the Spring XML Extensions

	<from uri="jms:queue:foo?concurrentConsumers=5"/>
	<threads poolSize="5">
				<simple>${in.header.type} == 'A'</simple>
				<to ref="messageDispatchProcessorA"/>
				<simple>${in.header.type} == 'B'</simple>
				<to ref="messageDispatchProcessorB"/>
				<simple>${in.header.type} == 'C'</simple>
				<to ref="messageDispatchProcessorC"/>
				<to uri="jms:queue:invalidMessageType"/>

See Also