| h1. Camel NMR Component |
| |
| The Camel NMR component is an adapter to the Normalized Message Router (NMR) in ServiceMix, which is intended for use by Camel applications deployed directly into the OSGi container. |
| |
| h2. Installing |
| |
| In order to be able to use this component, you first have to define it in your Spring configuration file ({{META-INF/spring/*.xml}}) by adding the following {{bean}}: |
| |
| {code} |
| <beans xmlns:osgi="http://www.springframework.org/schema/osgi" ... > |
| ... |
| <bean id="nmr" class="org.apache.servicemix.camel.nmr.ServiceMixComponent"> |
| <property name="nmr"> |
| <osgi:reference interface="org.apache.servicemix.nmr.api.NMR" /> |
| </property> |
| </bean> |
| ... |
| </beans> |
| {code} |
| |
| h2. NMR consumer and producer endpoints |
| |
| The following code: |
| |
| {code} |
| from("nmr:MyServiceEndpoint") |
| {code} |
| |
| Automatically exposes a new endpoint to the bus with endpoint name {{MyServiceEndpoint}} (see [#URI-format]). |
| |
| When an NMR endpoint appears at the end of a route, for example: |
| |
| {code} |
| to("nmr:MyServiceEndpoint") |
| {code} |
| |
| The messages sent by this producer endpoint are sent to the already deployed JBI endpoint. |
| |
| h2. URI format |
| |
| {code} |
| nmr:endpointName |
| {code} |
| |
| h4. URI Options |
| - *{{synchronous}}* (defaults to {{false}}) :: When this is set to {{true}} on a consumer endpoint, an incoming, synchronous NMR Exchange will be handled on the sender's thread instead of being handled on a new thread of the NMR endpoint's thread pool | |
| |
| |
| h3. Examples |
| |
| {code} |
| from("nmr:MyServiceEndpoint") |
| from("nmr:MyServiceEndpoint?synchronous=true").to("nmr:AnotherEndpoint") |
| {code} |