...
Before we can learn about accessing other services on the JBI ESB, we have to
Excerpt |
---|
add a JMS SU with two endpoints to pro with |
Adding a JMS SU
Creating the JMS SU
You can create the JMS SU by using the Maven archetype for it in your project's root:
No Format |
---|
mvn archetype:create -DarchetypeArtifactId=servicemix-jms-provider-service-unit -DarchetypeGroupId=org.apache.servicemix.tooling -DartifactId=tutorial-camel-jms-su |
Adding the JMS SU to our SA
To do this, just add the SU as a dependency to your SA's pom.xml:
...
Info | ||
---|---|---|
| ||
If you are using Eclipse for taking this tutorial, you should take a minute at this point to re-run |
Configuring the JMS SU
Now, modify the JMS SU's xbean.xml to configure a sample consumer and provider endpoint, both referring to the same queue like this:
Code Block | ||||
---|---|---|---|---|
| ||||
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" xmlns:tutorial="urn:org:apache:servicemix:tutorial:camel" xmlns:amq="http://activemq.org/config/1.0"> <jms:provider service="tutorial:jms" endpoint="provider" destinationName="tutorial.camel.queue" connectionFactory="#connectionFactory" /> <jms:consumer service="tutorial:jms" endpoint="consumer" destinationName="tutorial.camel.queue" connectionFactory="#connectionFactory" targetService="tutorial:jms" targetEndpoint="consumer" /> <amq:connectionFactory id="connectionFactory" brokerURL="tcp://localhost:61616" /> </beans> |
Build and deploy the SA
Just to make sure you haven't made any mistakes here, quickly build and deploy the SA again now. Feel free to connect to ServiceMix using a JMX console to convince yourself that the new endpoints are actually available. Leave the JMX console running for now, you'll be needing it in our next step as well.
...