Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 13. Introduction to the Red Hat JBoss Fuse JMS Binding Component
Abstract
Overview Copier lienLien copié sur presse-papiers!
- Consumer Endpoints
- A Consumer endpoint's primary roll is to listen for messages on an external JMS destination and pass them into to the NMR for delivery to endpoints inside of the Red Hat JBoss Fuse container. Consumer endpoints can send responses if one is required.
- Provider Endpoints
- A Provider endpoint's primary roll is to take messages from the NMR and send them to an external JMS destination.
xbean.xml file. There are some instances where you will need to develop your own Java classes to supplement the basic functionality provided by the binding components default implementations. These cases are discussed at the end of this guide.
Key features Copier lienLien copié sur presse-papiers!
- Support for JMS 1.0.2 and JMS 1.1
- JMS transactions
- XA transactions
- Support of all MEP patterns
- SOAP support
- MIME support
- Customizable message marshaling
Contents of a JMS service unit Copier lienLien copié sur presse-papiers!
xbean.xml- The
xbean.xmlfile contains the XML configuration for the endpoint defined by the service unit. The contents of this file are the focus of this guide.NoteThe service unit can define more than one endpoint. meta-inf/jbi.xml- The
jbi.xmlfile is the JBI descriptor for the service unit. Example 13.1, “JBI Descriptor for a JMS Service Unit” shows a JBI descriptor for a JMS service unit.Example 13.1. JBI Descriptor for a JMS Service Unit
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The elements shown in Example 13.1, “JBI Descriptor for a JMS Service Unit” do the following:- 1
- The
serviceelement is the root element of all service unit descriptors. The value of thebinding-componentattribute is alwaysfalse. - 2
- The
serviceelement contains namespace references for all of the namespaces defined in thexbean.xmlfile'sbeanelement. - 3
- The
provideselement corresponds to a JMS provider endpoint. Theservice-nameattribute derives its value from theserviceattribute in the JMS provider's configuration.NoteThis attribute can also appear on aconsumeselement. - 4
- The
endpoint-nameattribute derives its value from theendpointattribute in the JMS provider's configuration.NoteThis attribute can also appear on aconsumeselement. - 5
- The
consumeselement corresponds to a JMS consumer endpoint. Theinterface-nameattribute derives its value from theinterfaceNameattribute in the JMS consumer's configuration.NoteThis attribute can also appear on aprovideselement.
Using the Maven JBI tooling Copier lienLien copié sur presse-papiers!
- servicemix-jms-consumer-endpoint
- The servicemix-jms-consumer-endpoint archetype creates a project that results in a service unit that configures a JMS consumer endpoint.TipYou can use the smx-arch command to in place of typing the entire Maven command.
smx-arch su jms-consumer ["-DgroupId=my.group.id"] ["-DartifactId=my.artifact.id"]
smx-arch su jms-consumer ["-DgroupId=my.group.id"] ["-DartifactId=my.artifact.id"]Copy to Clipboard Copied! Toggle word wrap Toggle overflow - servicemix-jms-provider-endpoint
- The servicemix-jms-provider-endpoint archetype creates a project that results in a service unit that configures a JMS provider endpoint.TipYou can use the smx-arch command to in place of typing the entire Maven command.
smx-arch su jms-provider ["-DgroupId=my.group.id"] ["-DartifactId=my.artifact.id"]
smx-arch su jms-provider ["-DgroupId=my.group.id"] ["-DartifactId=my.artifact.id"]Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- a
pom.xmlfile containing the metadata needed to generate and package the service unit - a
src/main/resources/xbean.xmlfile containing the configuration for the endpointImportantThe endpoint configuration generated by the archetype is for the deprecated JMS endpoints. While this configuration will work, it is not recommended for new projects and is not covered in this guide.
java folder to the generated src folder. You also need to modify the generated pom.xml file to compile the code and package it with the service unit.
OSGi Packaging Copier lienLien copié sur presse-papiers!
- include an OSGi bundle manifest in the
META-INFfolder of the bundle - add the following to your service unit's configuration file:
<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Namespace Copier lienLien copié sur presse-papiers!
http://servicemix.apache.org/jms/1.0 namespace. You will need to add a namespace declaration similar to the one in Example 13.2, “Namespace Declaration for Using JMS Endpoints” to your xbeans.xml file's beans element.
Example 13.2. Namespace Declaration for Using JMS Endpoints
<beans ...
xmlns:jms="http://servicemix.apache.org/jms/1.0"
... >
...
</beans>
<beans ...
xmlns:jms="http://servicemix.apache.org/jms/1.0"
... >
...
</beans>
beans element's xsi:schemaLocation as shown in Example 13.3, “Schema Location for Using JMS Endpoints”.
Example 13.3. Schema Location for Using JMS Endpoints