-
Language:
English
-
Language:
English
Red Hat Training
A Red Hat training course is available for Red Hat Fuse
Using the JMS Binding Component
Connecting applications using JMS
Copyright © 2013 Red Hat, Inc. and/or its affiliates.
Abstract
Chapter 1. Introduction to the Red Hat JBoss Fuse JMS Binding Component
Abstract
Overview
- 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
- 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
xbean.xml
- The
xbean.xml
file 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.xml
file is the JBI descriptor for the service unit. Example 1.1, “JBI Descriptor for a JMS Service Unit” shows a JBI descriptor for a JMS service unit.Example 1.1. JBI Descriptor for a JMS Service Unit
The elements shown in Example 1.1, “JBI Descriptor for a JMS Service Unit” do the following:- 1
- The
service
element is the root element of all service unit descriptors. The value of thebinding-component
attribute is alwaysfalse
. - 2
- The
service
element contains namespace references for all of the namespaces defined in thexbean.xml
file'sbean
element. - 3
- The
provides
element corresponds to a JMS provider endpoint. Theservice-name
attribute derives its value from theservice
attribute in the JMS provider's configuration.NoteThis attribute can also appear on aconsumes
element. - 4
- The
endpoint-name
attribute derives its value from theendpoint
attribute in the JMS provider's configuration.NoteThis attribute can also appear on aconsumes
element. - 5
- The
consumes
element corresponds to a JMS consumer endpoint. Theinterface-name
attribute derives its value from theinterfaceName
attribute in the JMS consumer's configuration.NoteThis attribute can also appear on aprovides
element.
Using the Maven JBI tooling
- 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"]
- 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"]
- a
pom.xml
file containing the metadata needed to generate and package the service unit - a
src/main/resources/xbean.xml
file 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
- include an OSGi bundle manifest in the
META-INF
folder of the bundle - add the following to your service unit's configuration file:
<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />
Namespace
http://servicemix.apache.org/jms/1.0
namespace. You will need to add a namespace declaration similar to the one in Example 1.2, “Namespace Declaration for Using JMS Endpoints” to your xbeans.xml
file's beans
element.
Example 1.2. Namespace Declaration for Using JMS Endpoints
<beans ...
xmlns:jms="http://servicemix.apache.org/jms/1.0"
... >
...
</beans>
beans
element's xsi:schemaLocation
as shown in Example 1.3, “Schema Location for Using JMS Endpoints”.
Example 1.3. Schema Location for Using JMS Endpoints
<beans ... xsi:schemaLocation="... http://servicemix.apache.org/jms/1.0 http://servicemix.apache.org/jms/1.0/servicemix-jms.xsd ..."> ... </beans>
Chapter 2. Configuring the Connection Factory
Abstract
ConnectionFactory
object to create connections to the broker. The ConnectionFactory
object is a JMS object that is provided along with the JMS broker. Each JMS provider has a unique ConnectionFactory
object that uses properties specific to a particular JMS implementation.
ConnectionFactory
object. Often the ConnectionFactory
object is looked up through JNDI. However, the information needed depends on the JMS provider you are using.
ConnectionFactory
objects for each of these platforms.
2.1. Using Apache ActiveMQ Connection Factories
Overview
InstallDir\lib
folder.
Namespace
beans
element:
xmlns:amqpool="http://jencks.org/amqpool/2.0"
Simple pool
amqpool:pool
element. The attributes used to configure the simple pooled connection factory are described in Table 2.1, “Attributes for Configuring the Simple AMQPool Connection Factory”.
Table 2.1. Attributes for Configuring the Simple AMQPool Connection Factory
Example 2.1. Configuring a Simple AMQPool Connection Factory
<beans xmlns:amqpool="http://jencks.org/amqpool/2.0" ... > ... <amqpool:pool id="connectionFactory" url="tcp://localhost:61616" maxConnections="8" /> </beans>
XA pool
amqpool:xa-pool
element. The attributes used to configure the XA pooled connection factory are described in Table 2.2, “Attributes for Configuring the XA AMQPool Connection Factory”.
Table 2.2. Attributes for Configuring the XA AMQPool Connection Factory
Example 2.2. Configuring an XA AMQPool Connection Factory
<beans xmlns:amqpool="http://jencks.org/amqpool/2.0" xmlns:jencks="http://jencks.org/2.0" ... > ... <amqpool:xa-pool id="connectionFactory" url="tcp://localhost:61616" maxConnections="8" transactionManager="#transactionManager" /> <jencks:transactionManager id="transactionManager" transactionLogDir="./data/txlog" defaultTransactionTimeoutSeconds="600" /> </beans>
JCA pool
amqpool:jca-pool
element. The attributes used to configure the JCA pooled connection factory are described in Table 2.3, “Attributes for Configuring the JCA AMQPool Connection Factory”.
Table 2.3. Attributes for Configuring the JCA AMQPool Connection Factory
Example 2.3. Configuring a JCA AMQPool Connection Factory
<beans xmlns:amqpool="http://jencks.org/amqpool/2.0" xmlns:jencks="http://jencks.org/2.0" ... > ... <amqpool:jca-pool id="connectionFactory" url="tcp://localhost:61616" maxConnections="8" transactionManager="#transactionManager" name="joeFred" /> <jencks:transactionManager id="transactionManager" transactionLogDir="./data/txlog" defaultTransactionTimeoutSeconds="600" /> </beans>
2.2. Using JNDI
Overview
Spring JEE JNDI lookup
- Add the following namespace declaration to your
beans
element in your service unit's configuration.xmlns:jee="http://www.springframework.org/schema/jee"
- Add a
jee:jndi-lookup
element to your service unit's configuration.Thejee:jndi-lookup
element has two attributes. They are described in Table 2.4, “Attributes for Using Spring's JEE JNDI Lookup”. - Add a
jee:environment
child element to thejee:jndi-lookup
element.Thejee:environment
element contains a collection of Java properties that are used to access the JNDI provider. These properties will be provided by your JNDI provider's documentation.
Example 2.4. Getting the WebLogic Connection Factory Using Spring's JEE JNDI Look-up
<beans xmlns:jee="http://www.springframework.org/schema/jee" ... > ... <jee:jndi-lookup id="connectionFactory" jndi-name="weblogic.jms.XAConnectionFactory"> <jee:environment> java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory java.naming.provider.url=t3://localhost:7001 </jee:environment> </jee:jndi-lookup> ... </beans>
Spring JNDI Templates
JndiTemplate
bean. Using this approach, you configure an instance of the JndiTemple
bean and then use the bean to perform all of your JNDI look-ups using a JndiObjectFactoryBean
bean.
- Add a
bean
element to your configuration for the JNDI template.- Set the
bean
element'sid
attribute to a unique identifier. - Set the
bean
element'sclass
attribute toorg.springframework.jndi.JndiTemplate
. - Add a
property
child element to thebean
element.Theproperty
element will contain the properties for accessing the JNDI provider. - Set the
property
element'sname
attribute toenvironment
. - Add a
props
child to theproperty
element. - Add a
prop
child element to theprops
element for each Java property needed to connect to the JNDI provider.Aprop
element has a single attribute calledkey
whose value is the name of the Java property being set. The value of the element is the value of the Java property being set. Example 2.5, “Setting a Java Property” shows aprop
element for setting the java.naming.factory.initial property.Example 2.5. Setting a Java Property
<prop key="java.naming.factory.initial"> com.sun.jndi.fscontext.RefFSContextFactory </prop>
NoteThe properties you need to set will be determined by your JNDI provider. Check its documentation.
- Add a
bean
element to your configuration to retrieve the JMS connection factory using the JNDI template.- Set the
bean
element'sid
attribute to a unique identifier. - Set the
bean
element'sclass
attribute toorg.springframework.jndi.JndiObjectFactoryBean
. - Add a
property
child element to thebean
element.Thisproperty
element loads the JNDI template to be used for the look-up. You must set itsname
attribute tojndiTemplate
. The value of itsref
attribute is taken from thename
attribute of thebean
element that configured the JNDI template. - Add a second
property
child element to thebean
element.Thisproperty
element specifies the JNDI name of the connection factory. You must set itsname
attribute tojndiTemplate
. - Add a
value
child element to theproperty
element.The value of the element is the JNDI name of the connection factory.
Example 2.6. Using a JNDI Template to Look Up a Connection Factory
<beans ... > ... <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate"> <property name="environment"> <props> <prop key="java.naming.factory.initial"> com.sun.jndi.fscontext.RefFSContextFactory </prop> <prop key="java.naming.provider.url"> file:/tmp/ </prop> </props> </property> </bean> <bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiTemplate" ref="jndiTemplate" /> <property name="jndiName"> <value>MQConnFactory</value> </property> </bean> ... </beans>
2.3. Using a Spring Bean
Overview
ConnectionFactory
for your JMS provider.
Example
Example 2.7. Configuring a Connection Factory with a Spring Bean
<bean id="connectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory"> <property name="transportType"> <util:constant static-field="com.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP" /> </property> <property name="queueManager" value="my.queue.mgr" /> <property name="hostName" value="myHost" /> <property name="channel" value="myChannel" /> <property name="port" value="12345" /> </bean>
Chapter 3. Creating a Consumer Endpoint
Abstract
MessageListener
interface.
3.1. Introduction to Consumer Endpoints
Where does a consumer fit into a solution?
Figure 3.1. Consumer Endpoint
Types of consumer endpoints
- Generic
- The generic consumer endpoint can handle any type of message data. It is configured using the
jms:consumer
element. - SOAP
- The SOAP consumer endpoint is specifically tailored to receive SOAP messages. It uses a WSDL document to define the structure of the messages. It is configured using the
jms:soap-consumer
element.TipThe Apache CXF binding component's JMS transport is better adapted to handling SOAP messages, but offers less control over the JMS connection. - JCA
- The JCA consumer endpoint uses JCA to connect to the JMS provider. It is configured using the
jms:jca-consumer
element. For more information on using the JCA consumer endpoint, see Section 3.3, “Using the JCA Consumer Endpoint”.
3.2. Using the Generic Endpoint or the SOAP Endpoint
3.2.1. Basic Configuration
Procedure
- Decide what type of consumer endpoint to use.
- Specify the name of the service for which this endpoint is acting as a proxy.This is specified using the
service
attribute.TipIf you are using a SOAP consumer and your WSDL file only has one service defined, you do not need to specify the service name. - Specify the name of the endpoint for which this endpoint is acting as a proxy.This is specified using the
endpoint
attribute.TipIf you are using a SOAP consumer and your WSDL file only has one endpoint defined, you do not need to specify the endpoint name. - Specify the connection factory the endpoint will use.The endpoint's connection factory is configured using the endpoint's
connectionFactory
attribute. TheconnectionFactory
attribute's value is a reference to the bean that configures the connection factory. For example, if the connection factory configuration bean is namedwidgetConnectionFactory
, the value of theconnectionFactory
attribute would be#widgetConnectionFactory
.For information on configuring a connection factory see Chapter 2, Configuring the Connection Factory. - Specify the destination onto which the endpoint will place messages.For more information see the section called “Configuring a destination”.
- Specify the ESB endpoint to which incoming messages are targeted.For more information see the section called “Specifying the target endpoint”.
- If you are using a JMS SOAP consumer, specify the location of the WSDL defining the message exchange using the
wsdl
attribute. - If your JMS destination is a topic, set the
pubSubDomaim
attribute totrue
. - If your endpoint is interacting with a broker that only supports JMS 1.0.2, set the
jms102
attribute totrue
.
Configuring a destination
- The endpoint will check to see if you configured the destination explicitly.You configure a destination using a Spring bean. You can add the bean directly to the endpoint by wrapping it in a
jms:destination
child element. You can also configure the bean separately and refer the bean using the endpoint'sdestination
attribute as shown in Example 3.1, “Configuring a Consumer's Destination”.Example 3.1. Configuring a Consumer's Destination
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:consumer service="my:widgetService" endpoint="jbiWidget" destination="#widgetQueue" ... /> ... <jee:jndi-lookup id="widgetQueue" jndi-name="my.widget.queue"> <jee:environment> java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory java.naming.provider.url=t3://localhost:7001 </jee:environment> </jee:jndi-lookup> ... </beans>
- If you did not explicitly configure a destination, the endpoint will use the value of the
destinationName
attribute to choose its destination.The value of thedestinationName
attribute is a string that will be used as the name for the JMS destination. The binding component's default behavior when you provide a destination name is to resolve the destination using the standard JMSSession.createTopic()
andSession.createQueue()
methods.NoteYou can override the binding component's default behavior by providing a customDestinationResolver
implementation. See Section 7.2, “Using a Custom Destination Resolver”.
Specifying the target endpoint
- If you explicitly specify an endpoint using both the
targetService
attribute and thetargetEndpoint
attribute, the ESB will use that endpoint.ThetargetService
attribute specifies the QName of a service deployed into the ESB. ThetargetEndpoint
attribute specifies the name of an endpoint deployed by the service specified by thetargetService
attribute. - If you only specify a value for the
targetService
attribute, the ESB will attempt to find an appropriate endpoint on the specified service. - If you do not specify a service name or an endpoint name, you must specify an the name of an interface that can accept the message using the
targetInterface
attribute. The ESB will attempt to locate an endpoint that implements the specified interface and direct the messages to it.Interface names are specified as QNames. They correspond to the value of thename
attribute of either a WSDL 1.1serviceType
element or a WSDL 2.0interface
element.
Examples
Example 3.2. Basic Configuration for a Generic Consumer Endpoint
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:consumer service="my:widgetService" endpoint="jbiWidget" destinationName="widgetQueue" connectionFactory="#connectionFactory" targetService="my:targetService" /> ... </beans>
Example 3.3. Basic Configuration for a SOAP Consumer Endpoint
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:soap-consumer wsdl="classpath:widgets.wsdl" destinationName="widgetQueue" connectionFactory="#connectionFactory" targetService="my:targetService" /> ... </beans>
3.2.2. Listener Containers
Overview
Types of listener containers
- Simple
- The simple listener container creates a fixed number of JMS sessions at startup and uses them throughout the lifespan of the container. It cannot dynamically adapt to runtime conditions nor participate in externally managed transactions.
- Default
- The default listener container provides the best balance between placing requirements on the JMS provider and features. Because of this, it is the default listerner container for Red Hat JBoss Fuse JMS consumer endpoints. The default listener container can adapt to changing runtime demands. It is also capable of participating in externally managed transactions.
- Server session
- The server session listener container leverages the JMS
ServerSessionPool
SPI to allow for dynamic management of JMS sessions. It provides the best runtime scaling and supports externally managed transactions. However, it requires that your JMS provider supports the JMSServerSessionPool
SPI.
Specifying an endpoint's listener container
listenerType
attribute. Table 3.1, “Values for Configuring a Consumer's Listener Container” lists the values for the listenerType
attribute.
Table 3.1. Values for Configuring a Consumer's Listener Container
Example 3.4. Configuring a SOAP Consumer to Use the Simple Listener Container
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
... >
...
<jms:soap-consumer wsdl="classpath:widgets.wsdl"
destinationName="widgetQueue"
connectionFactory="#connectionFactory"
listenerType="simple" />
...
</beans>
Performace tuning using the listener container
Table 3.2. Attributes Used to Performance Tune Standard JMS Consumers and SOAP JMS Consumers
Example 3.5. Tuning a Generic Consumer Endpoint
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:consumer service="my:widgetService" endpoint="jbiWidget" destinationName="widgetQueue" connectionFactory="#connectionFactory" cacheLevel="3" maxMessagesPerTask="1"/> ... </beans>
Configuring the server session listener container's session factory
ServerSessionPool
SPI to tune an endpoint's performance. In order for the listener container to function,k it uses a ServerSessionFactory
object. By default, the Red Hat JBoss Fuse JMS BC uses the Spring framework's SimpleServerSessionFactory
object. This server session factory creates a new JMS ServerSession
object with a new JMS session everytime it is called.
serverSessionFactory
attribute. This attribute provides a reference to the bean configuring the ServerSessionFactory
object.
ServerSessionFactory
object by adding a serverSessionFactory
child element to the endpoint's configuration. This element would wrap the ServerSessionFactory
object's configuration bean.
CommonsPoolServerSessionFactory
object as a session factory.
Example 3.6. Configuring a Consumer to Use a Pooled Session Factory
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:consumer service="my:widgetService" endpoint="jbiWidget" destinationName="widgetQueue" connectionFactory="#connectionFactory" listenerType="server" serverSessionFactory="#pooledSessionFactory"/> <bean id="pooledSessionFactory" class="org.springframework.jms.listener.serversession.CommonsPoolServerSessionFactory" /> ... </beans>
3.2.3. Advanced Configuration
Using transactions
transacted
attribute to specify the type of transactions to use. Table 3.3, “Consumer Transaction Support” describes the possible values for the transacted
attribute.
Table 3.3. Consumer Transaction Support
Value | Description |
---|---|
none | Specifies that message exchanges are not wrapped in a transaction. This is the default setting. |
jms | Specifies that message exchanges are wrapped in local JMS transactions. |
xa | Specifies that message exchanges will be wrapped in an externally managed XA transaction. You must also provide a transaction manager when using XA transactions. |
Using message selectors
messageSelector
attribute. The value of the attribute is the string value of the selector. For more information on the syntax used to specify message selectors, see the JMS 1.1 specification.
Using durable subscriptions
subscriptionDurable
attribute to true
. You specify the name used to register the durable subscription using the durableSubscriberName
attribute.
Example 3.7. Consumer using a Durable Subscription
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:soap-consumer wsdl="classpath:widgets.wsdl" destinationName="widgetQueue" connectionFactory="#connectionFactory" subscriptionDurable="true" durableSubscriberName="widgetSubscriber" /> ... </beans>
3.2.4. SOAP Specific Configuration
Overview
Using the JBI wrapper
useJbiWrapper
attribute to true
.
Example 3.8. Configuring a SOAP Consumer to Use the JBI Wrapper
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
... >
...
<jms:soap-consumer wsdl="classpath:widgets.wsdl"
destinationName="widgetQueue"
connectionFactory="#connectionFactory"
useJbiWrapper="true" />
...
</beans>
WSDL verification
validateWsdl
attribute to false
.
3.3. Using the JCA Consumer Endpoint
Procedure
- Specify the name of the service for which this endpoint is acting as a proxy.This is specified using the
service
attribute. - Specify the name of the endpoint for which this endpoint is acting as a proxy.This is specified using the
endpoint
attribute. - Specify the connection factory the endpoint will use.The endpoint's connection factory is configured using the endpoint's
connectionFactory
attribute. TheconnectionFactory
attribute's value is a reference to the bean that configures the connection factory. For example if the connection factory configuration bean is namedwidgetConnectionFactory
, the value of theconnectionFactory
attribute would be#widgetConnectionFactory
.For information on configuring a connection factory see Chapter 2, Configuring the Connection Factory. - Specify the destination onto which the endpoint will place messages.For more information see the section called “Configuring a destination”.
- Configure the JCA resource adapter that the consumer will use.You configure the endpoint's resource adapter using the
resourceAdapter
attribute. The attribute's value is a reference to the bean that configures the resource adapter. - Configure the
ActivationSpec
object that will be used by the endpoint.You configure the endpoint's resource adapter using theactivationSpec
attribute. The attribute's value is a reference to the bean that configures theActivationSpec
object. - Specify the ESB endpoint to which incoming messages are targeted.For more information see the section called “Specifying the target endpoint”.
- If your JMS destination is a topic, set the
pubSubDomaim
attribute totrue
.
Configuring a destination
- The endpoint will check to see if you configured the destination explicitly.You configure a destination using a Spring bean. You can add the bean directly to the endpoint by wrapping it in a
jms:destination
child element. You can also configure the bean separately and refer the bean using the endpoint'sdestination
attribute as shown in Example 3.9, “Configuring a JCA Consumer's Destination”.Example 3.9. Configuring a JCA Consumer's Destination
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:jca-consumer service="my:widgetService" endpoint="jbiWidget" destination="#widgetQueue" ... /> ... <jee:jndi-lookup id="widgetQueue" jndi-name="my.widget.queue"> <jee:environment> java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory java.naming.provider.url=t3://localhost:7001 </jee:environment> </jee:jndi-lookup> ... </beans>
- If you did not explicitly configure a destination, the endpoint will use the value of the
destinationName
attribute to choose its destination.The value of thedestinationName
attribute is a string that corresponds to the name of the JMS destination. The binding component's default behavior when you provide a destination name is to resolve the destination using the standard JMSSession.createTopic()
andSession.createQueue()
methods.NoteYou can override the binding component's default behavior by providing a customDestinationResolver
implementation. See Section 7.2, “Using a Custom Destination Resolver”.
Specifying the target endpoint
- If you explicitly specify an endpoint using both the
targetService
attribute and thetargetEndpoint
attribute, the ESB will use that endpoint.ThetargetService
attribute specifies the QName of a service deployed into the ESB. ThetargetEndpoint
attribute specifies the name of an endpoint deployed by the service specified by thetargetService
attribute. - If you only specify a value for the
targetService
attribute, the ESB will attempt to find an appropriate endpoint on the specified service. - If you do not specify a service name or an endpoint name, you must specify an the name of an interface that can accept the message using the
targetInterface
attribute. The ESB will attempt to locate an endpoint that implements the specified interface and direct the messages to it.Interface names are specified as QNames. They correspond to the value of thename
attribute of either a WSDL 1.1serviceType
element or a WSDL 2.0interface
element.
Example
Example 3.10. Basic Configuration for a JCA Consumer Endpoint
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:jca-consumer service="my:widgetService" endpoint="jbi" destinationName="widgetQueue" connectionFactory="#connectionFactory" resourceAdapter="#ra" activationSpec="#as" targetService="my:targetService" /> <bean id="ra" class="org.activemq.ra.ActiveMQConnectionFactory"> ... </bean> <bean id="as" class="org.apache.activemq.ra.ActiveMQActivationSpec"> ... </bean> ... </beans>
3.4. Configuring How Replies are Sent
- the reply message's priority
- the reply message's persistence
- the reply message's lifespan
3.4.1. Configuring the Reply Destination
Overview
Determining the reply destination
- If the in message of the exchange includes a value for the JMSReplyTo property, that value is used as the reply destination.
- If the JMSReplyTo is not specified, the endpoint looks for a destination chooser implementation to use.If you have configured your endpoint with a destination chooser, the endpoint will use the destination chooser to select the reply destination.For more information on using destination choosers see Section 7.1, “Using a Custom Destination Chooser”.
- If the JMSReplyTo is not specified and there is no configured destination chooser, the endpoint checks its
replyDestination
attribute for a destination.You configure a destination using a Spring bean. The recommend method to configure the destination is to configure the bean separately and refer the bean using the endpoint'sreplyDestination
attribute as shown in Example 3.11, “Configuring a Consumer's Reply Destination”. You can also add the bean directly to the endpoint by wrapping it in ajms:replyDestination
child element. - As a last resort, the endpoint will use the value of the
replyDestinationName
attribute to determine the reply destination.ThereplyDestinationName
attribute takes a string that is used as the name of the destination to use. The binding component's default behavior when you provide a destination name is to resolve the destination using the standard JMSSession.createTopic()
andSession.createTopic()
methods to resolve the JMS destination.NoteYou can override the binding component's default behavior by providing a customDestinationResolver
implementation. See Section 7.2, “Using a Custom Destination Resolver”.
Example
Example 3.11. Configuring a Consumer's Reply Destination
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:consumer service="my:widgetService" endpoint="jbiWidget" destinationName="my.widgetQueue" connectionFactory="#connectionFactory" replyDestination="#widgetReplyQueue" /> ... <jee:jndi-lookup id="widgetReplyQueue" jndi-name="my.widget.reply.queue"> <jee:environment> java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory java.naming.provider.url=t3://localhost:7001 </jee:environment> </jee:jndi-lookup> ... </beans>
3.4.2. Configuring the Qualities of Service
Overview
- the reply message's priority
- the reply message's persistence
- the reply message's lifespan
Setting the reply message's priority
replyPriority
attribute. The value is used to set the reply message's JMSPriority property.
Setting the reply message's persistence
replyDeliveryMode
attribute. The value you provide for the replyDeliveryMode
attribute is used to set the reply message's JMSDeliveryMode property.
deliveryMode
attribute to 2
. This setting corresponds to DeliveryMode.PERSISTENT
.
deliveryMode
attribute to 1
. This setting corresponds to DeliveryMode.NON_PERSISTENT
.
Setting a reply message's lifespan
replyTimeToLive
attribute. The value is the number of milliseconds you want the message to be available from the time it is sent.
replyTimeToLive
attribute is used to compute the value for the reply message's JMSExpirary property. The value is computed by adding the specified number of milliseconds to the time the message is created.
Enforcing the configured values
replyExplicitQosEnabled
to true
. Doing so instructs the consumer to always use the values provided in the configuration.
Example
Example 3.12. Consumer with Reply QoS Properties
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:jca-consumer service="my:widgetService" endpoint="jbiWidget" connectionFactory="#connectionFactory" destinationName="widgetQueue" resourceAdapter="#ra" activationSpec="#as" replyExplicitQosEnabled="true" replyDeliveryMode="1" replyPriority="0" /> ... </beans>
3.4.3. Setting Custom JMS Properties
Overview
map
element. You can configure one static map that will be applied to every reply message generated by the consumer.
Setting custom JMS header properties
Defining the property map
java.util.Map
object. You define that map object using the Spring util:map
element.
util:map
element is defined in the http://www.springframework.org/schema/util
namespace. In order to use the element you will need to add the following namespace alias to your beans
element:
xmlns:util="http://www.springframework.org/schema/util"
entry
child element's to the util:map
element. Each entry
element takes two attributes. The key
entry is the map key and corresponds to the properties name. The value
attribute is the value of the property.
entry
element's ref
attribute instead of the value
attribute. The ref
attribute points to another bean
element that defines a Java object.
Example
Example 3.13. Adding Custom Properties to a Reply Message
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" xmlns:util="http://www.springframework.org/schema/util" ... > ... <jms:consumer service="my:widgetService" endpoint="jbiWidget" destinationName="my.widgetQueue" connectionFactory="#connectionFactory" replyDestination="#widgetReplyQueue" replyProperties="#jmsProps" /> ... <util:map id="jmsProps"> <entry key="location" value="San Jose"/> <entry key="orig_code" value="sjwf"/> <entry key="client_code" value="widget010"/> </util:map> ... </beans>
Chapter 4. Creating a Provider Endpoint
Abstract
JMSTemplate
interface.
4.1. Introduction to Provider Endpoints
Where does a provider fit into a solution?
Figure 4.1. Provider Endpoint
Types of providers
- Generic
- The generic provider endpoint can handle any type of message data. It is configured using the
jms:provider
element. - SOAP
- The SOAP provider endpoint is specifically tailored to receive SOAP messages. It uses a WSDL document to define the structure of the messages. It is configured using the
jms:soap-provider
element.TipThe Apache CXF binding component's JMS transport is better adapted to handling SOAP messages, but offers less control over the JMS connection.
4.2. Basic Configuration
Procedure
- Decide what type of provider endpoint to use.
- Specify the name of the service for which this endpoint is acting as a proxy.This is specified using the
service
attribute.TipIf you are using a SOAP provider and your WSDL file only has one service defined, you do not need to specify the service name. - Specify the name of the endpoint for which this endpoint is acting as a proxy.This is specified using the
endpoint
attribute.TipIf you are using a SOAP provider and your WSDL file only has one endpoint defined, you do not need to specify the endpoint name. - Specify the connection factory the endpoint will use.The endpoint's connection factory is configured using the endpoint's
connectionFactory
attribute. TheconnectionFactory
attribute's value is a reference to the bean that configures the connection factory. For example, if the connection factory configuration bean is namedwidgetConnectionFactory
, the value of theconnectionFactory
attribute would be#widgetConnectionFactory
.For information on configuring a connection factory see Chapter 2, Configuring the Connection Factory. - Specify the destination onto which the endpoint will place messages.For more information see the section called “Configuring a destination”.
- If you are using a JMS SOAP provider, specify the location of the WSDL defining the message exchange using the
wsdl
attribute. - If your JMS destination is a topic, set the
pubSubDomaim
attribute totrue
. - If your endpoint is interacting with a broker that only supports JMS 1.0.2, set the
jms102
attribute totrue
.
Configuring a destination
- If you provided a custom
DestinationChooser
implementation, the endpoint will use that to choose it's endpoint.For more information about providing customDestinationChooser
implementations see Section 7.1, “Using a Custom Destination Chooser”. - If you did not provide a custom
DestinationChooser
implementation, the endpoint will use its defaultDestinationChooser
implementation to choose an endpoint.The default destination chooser checks the message exchange received from the NMR for a DESTINATION_KEY property. If the message exchange has that property set, it returns that destination. - If the destination chooser does not return a destination, the endpoint will check to see if you configured the destination explicitly.You configure a destination using a Spring bean. The recommend way to configure the destination is to configure the bean separately and refer the bean using the endpoint's
destination
attribute as shown in Example 4.1, “Configuring a Provider's Destination”. You can also add the bean directly to the endpoint by wrapping it in ajms:destination
child element.Example 4.1. Configuring a Provider's Destination
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:provider service="my:widgetService" endpoint="jbiWidget" destination="#widgetQueue" connectionFactory="#connectionFactory" /> ... <jee:jndi-lookup id="widgetQueue" jndi-name="my.widget.queue"> <jee:environment> java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory java.naming.provider.url=t3://localhost:7001 </jee:environment> </jee:jndi-lookup> ... </beans>
- If the destination chooser does not return a destination and you did not explicitly configure a destination, the endpoint will use the value of the
destinationName
attribute to choose its destination.ThedestinationName
attribute takes a string that is used as the name of the destination to use. The binding component's default behavior when you provide a destination name is to resolve the destination using the standard JMSSession.createTopic()
andSession.createQueue()
methods to resolve the JMS destination.NoteYou can override the binding component's default behavior by providing a customDestinationResolver
implementation. See Section 7.2, “Using a Custom Destination Resolver”.
Examples
Example 4.2. Basic Configuration for a Generic Provider Endpoint
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:provider service="my:widgetService" endpoint="jbiWidget" destinationName="widgetQueue" connectionFactory="#connectionFactory" /> ... </beans>
Example 4.3. Basic Configuration for a SOAP Provider Endpoint
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:soap-provider wsdl="classpath:widgets.wsdl" destinationName="widgetQueue" connectionFactory="#connectionFactory" /> ... </beans>
4.3. Configuring How Responses are Received
Overview
Configuring the response destination
- If you provided a custom
DestinationChooser
implementation, the endpoint will use that to choose it's endpoint.For more information about providing customDestinationChooser
implementations see Section 7.1, “Using a Custom Destination Chooser”. - If you did not provide a custom
DestinationChooser
implementation, the endpoint will use its defaultDestinationChooser
implementation to choose an endpoint.The default destination chooser checks the message exchange received from the NMR for a DESTINATION_KEY property. If the message exchange has that property set, it returns that destination. - If the destination chooser does not return a destination, the endpoint will check to see if you configured the destination explicitly.You configure a response destination using a Spring bean. The recommend way to configure the destination is to configure the bean separately and refer the bean using the endpoint's
replyDestination
attribute as shown in Example 4.1, “Configuring a Provider's Destination”. You can also add the bean directly to the endpoint by wrapping it in ajms:replyDestination
child element. - If the destination chooser does not return a destination and you did not explicitly configure a destination, the endpoint will use the value of the
replyDestinationName
attribute to choose its destination.ThereplyDestinationName
attribute takes a string that is used as the name of the destination to use. The binding component's default behavior when you provide a destination name is to resolve the destination using the standard JMSSession.createTopic()
andSession.createTopic()
methods to resolve the JMS destination.NoteYou can override the binding component's default behavior by providing a customDestinationResolver
implementation. See Section 7.2, “Using a Custom Destination Resolver”.
Configuring the timeout interval
recieveTimeout
attribute. The recieveTimeout
attribute specifies the number of milliseconds the provider endpoint will wait for a response before timing out.
Example
Example 4.4. JMS Provider Endpoint with a Response Destination
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:soap-provider wsdl="classpath:widgets.wsdl" destinationName="widgetQueue" connectionFactory="#connectionFactory" recieveTimeout="60000" replyDestinationName="widgetResponse" /> ... </beans>
4.4. Advanced Provider Configuration
4.4.1. JMS Message Qualities of Service
Overview
- the message's relative priority
- the message's persistence
- the message's lifespan
Setting a message's priority
priority
attribute. The value you provide for the priority
attribute is used to set the JMS message's JMSPriority property.
Setting a message's persistence
deliveryMode
attribute. The value you provide for the deliveryMode
attribute is used to set the JMS message's JMSDeliveryMode property.
deliveryMode
attribute to 2
. This setting corresponds to DeliveryMode.PERSISTENT
.
deliveryMode
attribute to 1
. This setting corresponds to DeliveryMode.NON_PERSISTENT
.
Setting a message's life span
timeToLive
attribute. The value is the number of milliseconds you want the message to be available from the time it is sent. The default behavior is to allow messages to persist forever.
timeToLive
attribute is used to compute the value for the message's JMSExpirary property. The value is computed by adding the specified number of milliseconds to the time the message is created.
Enforcing configured values
explicitQosEnabled
attribute to true
.
Example
Example 4.5. Setting JMS Provider Endpoint Message Properties
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:soap-provider wsdl="classpath:widgets.wsdl" destinationName="widgetQueue" connectionFactory="#connectionFactory" priority="1" explicitQosEnabled="true" /> ... </beans>
4.4.2. JMS Message Optimization
Overview
Message IDs
messageIdEnabled
attribute to false
.
messageIdEnabled
attribute to false
causes the endpoint to call its message producer's setDisableMessageID()
method with a value of true
. The JMS broker is then given a hint that it does not need to generate message IDs or add them to the messages from the endpoint. The JMS broker can choose to accept the hint or ignore it.
Time stamps
messageTimeStampEnabled
attribute to false
.
messageTimeStampEnabled
attribute to false
causes the endpoint to call its message producer's setDisableMessageTimestamp()
method with a value of true
. The JMS broker is then given a hint that it does not need to generate message IDs or add them to the messages from the endpoint. The JMS broker can choose to accept the hint or ignore it.
4.4.3. SOAP Specific Configuration
Overview
Using the JBI wrapper
useJbiWrapper
attribute to true
.
Example 4.6. Configuring a SOAP Provider to Use the JBI Wrapper
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
... >
...
<jms:soap-provider wsdl="classpath:widgets.wsdl"
destinationName="widgetQueue"
connectionFactory="#connectionFactory"
useJbiWrapper="true" />
...
</beans>
WSDL verification
validateWsdl
attribute to false
.
Chapter 5. Making Endpoints Stateful
Abstract
Overview
Activating statefullness
stateless
attribute to false
.
Configuring the datastore
storeFactory
attribute to reference a bean configuring an instance of the org.apache.servicemix.store.jdbc.JdbcStoreFactory
class. Table 5.1, “Properties Used to Configure a JDBC Store Factory” list the properties you can set for the JDBC store factory.
Table 5.1. Properties Used to Configure a JDBC Store Factory
Name | Description |
---|---|
clustered | Specifies if a datastore can be accessed by the members of an endpoint cluster. |
transactional | Specifies if the datastore can be enlisted in transactions. |
dataSource | Specifies the configuration for the data source to be used when creating the store. |
adapter | Specifies the configuration for the JDBC adapter used to connect to the data source. |
Example
Example 5.1. Configuring a Statefull JMS Provider Endpoint
<jms:provider service="tns:widgetServer" endpoint="widgetPort" storeFactory="#storeFactory"> 1 stateless="false" /> 2 <bean id="storeFactory" 3 class="org.apache.servicemix.store.jdbc.JdbcStoreFactory"> <property name="clustered" value="true"/> <property name="dataSource"> <ref local="mysql-ds"/> </property> </bean> <bean id="mysql-ds" 4 class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="com.mysql.jdbc.Driver"/> <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activemq?relaxAutoCommit=true"/> <property name="user" value="activemq"/> <property name="password" value="activemq"/> <property name="minPoolSize" value="5"/> <property name="maxPoolSize" value="10"/> <property name="acquireIncrement" value="3"/> <property name="autoCommitOnClose" value="false"/> </bean>
- 1
- Configures the endpoint's store factory by providing a reference to the bean configuring the factory.
- 2
- Configures the endpoint to store a copy of the current message in the datastore.
- 3
- Configures the JDBC factory store to create a datastore that can be accessed by a cluster of endpoints.
- 4
- Configures the MySQL JDBC driver.
Chapter 6. Working with Message Marshalers
Abstract
6.1. Consumer Marshalers
Overview
org.apache.servicemix.jms.endpoints.JmsConsumerMarshaler
interface to process the incoming JMS messages and convert them into normalized messages. Consumer marshalers also convert fault messages and response messages into JMS messages that can be returned to the remote endpoint. The JMS binding component comes with two consumer marshaler implementations:
DefaultConsumerMarshaler
- The
DefaultConsumerMarshaler
class provides the marshaler used by generic consumer endpoints and the JCA consumer endpoints. JmsSoapConsumerMarshaler
- The
JmsSoapConsumerMarshaler
class provides the marshaler used by SOAP consumer endpoints.NoteThe default SOAP marshaler does not support the full range of SOAP messages nor does it support marshaling map based messages into JMS messages.
JmsConsumerMarshaler
interface.
Implementing the marshaler
org.apache.servicemix.jms.endpoints.JmsConsumerMarshaler
interface. The JmsConsumerMarshaler
interface, shown in Example 6.1, “The Consumer Marshaler Interface”, has five methods that need implementing:
Example 6.1. The Consumer Marshaler Interface
public interface JmsConsumerMarshaler { public interface JmsContext { Message getMessage(); } JmsContext createContext(Message message) throws Exception; MessageExchange createExchange(JmsContext jmsContext, ComponentContext jbiContext) throws Exception; Message createOut(MessageExchange exchange, NormalizedMessage outMsg, Session session, JmsContext context) throws Exception; Message createFault(MessageExchange exchange, Fault fault, Session session, JmsContext context) throws Exception; Message createError(MessageExchange exchange, Exception error, Session session, JmsContext context) throws Exception; }
createContext()
- The
createContext()
method takes the JMS message and returns an object that implements theJmsContext
interface. createExchange()
- The
createExchange()
creates a message exchange using the JMS message and the JBI context. Creating a message exchange entails the creation of the exchange, populating the exchange's in message, specifying the message exchange pattern to use, and setting any other required properties. createOut()
- The
createOut()
method takes the response message from the message exchange and converts it into a JMS message. The method takes the message exchange, the outgoing message, the active JMS session, and the JMS context. createFault()
- The
createFault()
method is called if a fault message is returned. It takes the message exchange, the fault message, the active JMS session, and the JMS context and returns a JMS message that encapsulates the fault message. createError()
- The
createError()
method is called if an exception is thrown while the message exchange is being processed. It takes the message exchange, the exception, the active JMS session, and the JMS context and returns a JMS message that encapsulates the exception.
JmsContext
interface. The JmsContext
interface has a single method called getMessage()
which returns the JMS message contained in the context.
Example 6.2. Consumer Marshaler Implementation
package com.widgetVendor.example; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import javax.jbi.component.ComponentContext; import javax.jbi.messaging.Fault; import javax.jbi.messaging.MessageExchange; import javax.jbi.messaging.NormalizedMessage; import javax.jms.Message; import javax.jms.Session; import javax.jms.TextMessage; import javax.xml.transform.Source; import org.apache.servicemix.jbi.jaxp.SourceTransformer; import org.apache.servicemix.jbi.jaxp.StringSource; import org.apache.servicemix.jbi.messaging.MessageExchangeSupport; public class widgetConsumerMarshaler implements JmsConsumerMarshaler { public JmsContext createContext(Message message) throws Exception { return new Context(message); } public MessageExchange createExchange(JmsContext jmsContext, ComponentContext jbiContext) throws Exception { Context ctx = (Context) jmsContext; MessageExchange exchange = jbiContext.getDeliveryChannel().createExchangeFactory().createExchange(MessageExchangeSupport.IN_ONLY); NormalizedMessage inMessage = exchange.createMessage(); TextMessage textMessage = (TextMessage) ctx.message; Source source = new StringSource(textMessage.getText()); inMessage.setContent(source); exchange.setMessage(inMessage, "in"); return exchange; } public Message createOut(MessageExchange exchange, NormalizedMessage outMsg, Session session, JmsContext context) throws Exception { String text = new SourceTransformer().contentToString(outMsg); return session.createTextMessage(text); } public Message createFault(MessageExchange exchange, Fault fault, Session session, JmsContext context) throws Exception { String text = new SourceTransformer().contentToString(fault); return session.createTextMessage(text); } public Message createError(MessageExchange exchange, Exception error, Session session, JmsContext context) throws Exception { throw error; } protected static class Context implements JmsContext { Message message; Context(Message message) { this.message = message; } public Message getMessage() { return this.message; } } }
Configuring the consumer
marshaler
attribute. The marshaler
attribute's value is a reference to a bean
element specifying the class of your custom marshaler implementation.
Example 6.3. Configuring a Consumer to Use a Customer Marshaler
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:soap-consumer wsdl="classpath:widgets.wsdl" destinationName="widgetQueue" connectionFactory="#connectionFactory" marshaler="#myConsumerMarshaler" /> <bean id="myConsumerMarshaler" class="com.widgetVendor.example.widgetConsumerMarshaler" /> ... </beans>
marshaler
element to the consumer's configuration. The marshaler
element simply wraps the bean
element that configures the marshaler.
6.2. Provider Marshalers
Overview
org.apache.servicemix.jms.endpoints.JmsProviderMarshaler
interface to convert normalized messages into JMS messages. The marshaler also converts the incoming reply from a JMS message into a normalized message. The JMS binding component comes with two provider marshaler implementations:
DefaultProviderMarshaler
- The
DefaultProviderMarshaler
class provides the marshaler used by generic provider endpoints. JmsSoapProviderMarshaler
- The
JmsSoapProviderMarshaler
class provides the marshaler used by SOAP provider endpoints.NoteThe default SOAP marshaler does not support the full range of SOAP messages nor does it support marshaling map based messages into JMS messages.
JmsProviderMarshaler
interface.
Implementing the marshaler
org.apache.servicemix.jms.endpoints.JmsProviderMarshaler
interface. The JmsProviderMarshaler
interface, shown in Example 6.4, “The Provider Marshaler Interface”, has two methods you need to implement:
Example 6.4. The Provider Marshaler Interface
public interface JmsProviderMarshaler { Message createMessage(MessageExchange exchange, NormalizedMessage in, Session session) throws Exception; void populateMessage(Message message, MessageExchange exchange, NormalizedMessage normalizedMessage) throws Exception; }
createMessage()
- The
createMessage()
method uses information from the Red Hat JBoss Fuse core to generate a JMS message. Its parameters include the message exchange, the normalized message that is received by the provider, and the active JMS session. populateMessage()
- The
populateMessage()
method takes a JMS message and adds it to a message exchange for use by the Red Hat JBoss Fuse core.
Example 6.5. Provider Marshaler Implementation
package com.widgetVendor.example; import javax.jbi.messaging.MessageExchange; import javax.jbi.messaging.NormalizedMessage; import javax.jms.Message; import javax.jms.Session; import javax.jms.TextMessage; import javax.xml.transform.Source; import org.apache.servicemix.jbi.jaxp.SourceTransformer; import org.apache.servicemix.jbi.jaxp.StringSource; import org.apache.servicemix.jms.endpoints.JmsProviderMarshaler; public class widgetProviderMarshaler implements JmsProviderMarshaler { private SourceTransformer transformer = new SourceTransformer(); public Message createMessage(MessageExchange exchange, NormalizedMessage in, Session session) throws Exception { TextMessage text = session.createTextMessage(); text.setText(transformer.contentToString(in)); return text; } public void populateMessage(Message message, MessageExchange exchange, NormalizedMessage normalizedMessage) throws Exception { TextMessage textMessage = (TextMessage) message; Source source = new StringSource(textMessage.getText()); normalizedMessage.setContent(source); } }
Configuring the provider
marshaler
attribute. The marshaler
attribute's value is a reference to a bean
element specifying the class of your custom marshaler implementation.
Example 6.6. Configuring a Provider to Use a Customer Marshaler
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:soap-provider wsdl="classpath:widgets.wsdl" destinationName="widgetQueue" connectionFactory="#connectionFactory" marshaler="#myProviderMarshaler" /> <bean id="myProviderMarshaler" class="com.widgetVendor.example.widgetProviderMarshaler" /> ... </beans>
marshaler
element to the provider's configuration. The marshaler
element simply wraps the bean
element that configures the marshaler.
Chapter 7. Implementing Destination Resolving Logic
Abstract
DestinationChooser
interface or the DestinationResolver
interface.
- destination choosers
- Destination choosers are specific to the Red Hat JBoss Fuse JMS binding component. They are the first mechanism used by an endpoint when it trys to pick a JMS destination.Destination choosers implement the
org.apache.servicemix.jms.endpoints.DestinationChooser
interface. - destination resolvers
- Destination resolvers are part of the Spring JMS framework. They are used when the JMS destination is specified using a string. This can happen if either the destination chooser returns a string or if the endpoint's destination is configured using the
destinationName
attribute.Destination resolvers implement theorg.springframework.jms.support.destination.DestinationResolver
interface.
7.1. Using a Custom Destination Chooser
Overview
org.apache.servicemix.jms.endpoints.DestinationChooser
interface and configure the endpoint to load it. The configured destination chooser will be used in place of the default destination chooser.
Implementing a destination chooser
org.apache.servicemix.jms.endpoints.DestinationChooser
interface. This interface has a single method: chooseDestination()
.
chooseDestination()
, whose signature is shown in Example 7.1, “Destination Chooser Method”, takes the JBI message exchange and a copy of the message. It returns either a JMS Destination
object or a string representing the destination name.
Example 7.1. Destination Chooser Method
Object chooseDestination(MessageExchange exchange,
Object message);
message
parameter can be either of the following type of object:
javax.jbi.messaging.NormalizedMessage
javax.jbi.messaging.Fault
Exception
Example 7.2. Simple Destination Chooser
package com.widgetVendor.example; import package org.apache.servicemix.jms.endpoints.DestinationChooser; import javax.jbi.messaging.MessageExchange; import javax.jbi.messaging.NormalizedMessage; import javax.jms.Destination; public class widgetDestinationChooser implements DestinationChooser { public static final String DESTINATION_KEY = "org.apache.servicemix.jms.destination"; public SimpleDestinationChooser() { } public Object chooseDestination(MessageExchange exchange, Object message) { Object property = null; if (message instanceof NormalizedMessage) { property = ((NormalizedMessage) message).getProperty(DESTINATION_KEY); } if (property instanceof Destination) { return (Destination) property; } if (property instanceof String) { return (String) property; } return new String("widgetDest"); } }
Configuring an endpoint to use a destination chooser
- Configure a
bean
element for your destination chooser. - Add a
destinationChooser
attribute that references the destination chooser's bean to your endpoint.
Example 7.3. Configuring a Destination Chooser with a Bean Reference
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
... >
...
<jms:provider service="my:widgetService"
endpoint="jbiWidget"
destinationName="widgetQueue"
connectionFactory="#connectionFactory"
destinationChooser="#widgetDestinationChooser" />
<bean id="widgetDestinationChooser"
class="com.widgetVendor.example.widgetDestinationChooser" />
...
</beans>
jms:destinationChooser
element. This method is less flexible than the recommended method because other endpoints cannot reuse the destination chooser's configuration.
Example 7.4. Explicitly Configuring a Destination Chooser
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:provider service="my:widgetService" endpoint="jbiWidget" destinationName="widgetQueue" connectionFactory="#connectionFactory"> <jms:destinationChooser> <bean id="widgetDestinationChooser" class="com.widgetVendor.example.widgetDestinationChooser" /> </jms:destinationChooser> </jms:provider> ... </beans>
7.2. Using a Custom Destination Resolver
Overview
Destination
objects. For example, if you specify an endpoint's destination using the destinationName
attribute, the endpoint will use a destination resolver to get the appropriate JMS Destination
object. Destination resolvers are also used if a destination chooser returns a string and not a JMS Destination
object.
DynamicDestinationResolver
destination resolver provided by the Spring Framework. This destination resolver uses the standard JMS Session.createTopic()
and Session.createQueue()
methods to resolve destination names.
JndiDestinationResolver
destination resolver. This destination resolver uses the string destination name to perform a JNDI lookup for the JMS destination. If JMS destination is not returned from the JNDI lookup, the resolver resorts to dynamically resolving the destination name. For information on configuring and endpoint to use the JndiDestinationResolver
destination resolver. See the section called “Configuring an endpoint to use a destination resolver”.
Implementing a destination resolver
org.springframework.jms.support.destination.DestinationResolver
interface. The interface has a single method: resolveDestinationName()
.
resolveDestinationName()
method, whose signature shown in Example 7.5, “Destination Resolver Method”, takes three parameters: a JMS session, a destination name, and a boolean specifying if the destination is a JMS topic.[1] It returns a JMS destination that correlates to the provided destination name.
Example 7.5. Destination Resolver Method
Destination resolveDestinationName(Session session,
String destinationName,
boolean pubSubDomain)
throws JMSException;
Example 7.6. Simple Destination Resolver
package com.widgetVendor.example; import org.springframework.jms.support.destination.DestinationResolver; import javax.jms.Destination; import javax.jms.JMSException; import javax.jms.Session; public class widgetDestinationResolver implements DestinationResolver { public Destination resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) throws JMSException { if (pubSubDomain) { return session.createTopic(destinationName); } else { return session.createQueue(destinationName); } } }
Configuring an endpoint to use a destination resolver
- Configure a
bean
element for your destination resolver. - Add a
destinationResolver
attribute that references the destination resolver's bean to your endpoint.
Example 7.7. Configuring a Destination Resolver with a Bean Reference
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
... >
...
<jms:consumer service="my:widgetService"
endpoint="jbiWidget"
destinationName="widgetQueue"
connectionFactory="#connectionFactory"
destinationResolver="#widgetDestinationResolver" />
<bean id="widgetDestinationResolver"
class="com.widgetVendor.example.widgetDestinationResolver" />
...
</beans>
jms:destinationResolver
element. This method is less flexible than the recommended method because other endpoints cannot reuse the destination resolver's configuration.
Example 7.8. Explicitly Configuring a Destination Resolver
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0" ... > ... <jms:consumer service="my:widgetService" endpoint="jbiWidget" destinationName="widgetQueue" connectionFactory="#connectionFactory"> <jms:destinationResolver> <bean id="widgetDestinationResolver" class="com.widgetVendor.example.widgetDestinationResolver" /> </jms:destinationChooser> </jms:consumer> ... </beans>
Appendix A. Consumer Endpoint Properties
A.1. Common Properties
Attributes
Table A.1. Common Consumer Endpoint Property Attributes
Name | Type | Description | Required |
---|---|---|---|
connectionFactory | string | Specifies a reference to the bean configuring the connection factory which is to be used by the endpoint. | yes |
service | QName | Specifies the service name of the proxied endpoint. | yes |
endpoint | string | Specifies the endpoint name of the proxied endpoint. | yes |
interfaceName | QName | Specifies the interface name of the proxied endpoint. | no |
jms102 | boolean | Specifies if the consumer uses JMS 1.0.2 compliant APIs. | no (defaults to false ) |
pubSubDomaim | boolean | Specifies if the destination is a topic. | no |
replyDeliveryMode | int | Specifies the JMS delivery mode used for the reply. | no (defaults to PERSISTENT (2)) |
replyDestinationName | string | Specifies the name of the JMS destination to use for the reply. | no (if not set replyDestination or destinationChooser is used) |
replyExplicitQosEnabled | boolean | Specifies if the QoS values specified for the endpoint are explicitly used when the reply is sent. | no (default is false) |
replyPriority | int | Specifies the JMS message priority of the reply. | no (defaults to 4) |
replyTimeToLive | long | Specifies the number of milliseconds the reply message is valid. | no (defaults to unlimited) |
stateless | boolean | Specifies if the consumer retains state information about the message exchange while it is in process. | no |
synchronous | boolean | Specifies if the consumer will block while waiting for a response. This means the consumer can only process one message at a time. | no (defaults to true) |
targetEndpoint | string | Specifies the endpoint name of the target endpoint. | no (defaults to the endpoint attribute) |
targetInterface | QName | Specifies the interface name of the target endpoint. | no |
targetService | QName | Specifies the service name of the target endpoint. | no (defaults to the service attribute) |
targetUri | string | Specifies the URI of the target endpoint. | no |
useMessageIdInResponse | boolean | Specifies if the request message's ID is used as the reply's correlation ID. | no (defaults to false meaning the request's correlation ID is used) |
Beans
Table A.2. Common Consumer Endpoint Property Beans
Name | Type | Description | Required |
---|---|---|---|
marshaler | JmsConsumerMarshaler | Specifies the class implementing the message marshaler. | no (defaults to DefaultConsumerMarshaler ) |
destinationChooser | DestinationChooser | Specifies a class implementing logic for choosing reply destinations. | no |
destinationResolver | DestinationResolver | Specifies the class implementing logic for converting strings into destination IDs. | no (defaults to DynamicDestinationResolver ) |
replyDestination | Destination | Specifies the JMS destination for the replies. | no (if not set either the replyDestinationName or the destinationChooser is used) |
replyProperties | Map | Specifies custom properties to be placed in the reply's JMS header. | no |
storeFactory | StoreFactory | Specifies the factory class used to create the data store for state information. | no (defaults to MemoryStoreFactory ) |
store | Store | Specifies the data store used to store state information. | no |
A.2. Properties Specific to Generic Consumers and SOAP Consumers
Common Attributes
jms:consumer
element and the jms:soap-consumer
elements.
Table A.3. Attributes Uses to Configure Standard JMS Consumers and SOAP JMS Consumers
Attribute | Type | Listener(s) | Description | Required |
---|---|---|---|---|
listenerType | string | all | Specifies the type of Spring JMS message listener to use. Valid values are default , simple , and server . | no (defaults to default ) |
transacted | string | all | Specifies the type of transaction used to wrap the message exchanges. Valid values are none , xa , and jms . | no (defaults to none ) |
clientId | string | all | Specifies the JMS client id for a shared Connection created and used by this listener. | no |
destinationName | string | all | Specifies the name of the destination used to receive messages. | no |
durableSubscriptionName | string | all | Specifies the name used to register the durable subscription. | no |
messageSelector | string | all | Specifies the message selector string to use. | no |
sessionAcknowlegeMode | int | all | Specifies the acknowledgment mode that is used when creating a Session to send a message. | no (defaults to Session.AUTO_ACKNOWLEDGE ) |
subscriptionDurable | boolean | all | Specifies if the listener uses a durable subscription to listen form messages. | no (defaults to false ) |
pubSubNoLocal | boolean |
default
simple
| Specifies if messages published by the listener's Connection are suppressed. | no (defaults to false ) |
concurrentConsumers | int |
default
simple
| Specifies the number of concurrent consumers created by the listener. | no (defaults to 1 ) |
cacheLevel | int | default | Specifies the level of caching allowed by the listener. | no (defaults to 0 ) |
receiveTimeout | long | default | Specifies the timeout for receiving a message in milliseconds. | no (default is 1000 ) |
recoveryInterval | long | default | Specifies the interval, in milliseconds, between attempts to recover after a failed listener set-up. | no (defaults to 5000 ) |
maxMessagesPerTask | int |
default
server
| Specifies the number of attempts to receive messages per task. | no (defaults to -1 ) |
Common Beans
jms:consumer
element and the jms:soap-consumer
elements.
Table A.4. Elements Uses to Configure Standard JMS Consumers and SOAP JMS Consumers
Element | Type | Listener(s) | Description | Required |
---|---|---|---|---|
destination | Destination | all | Specifies the destination used to receive messages. | no |
exceptionListener | ExceptionListener | all | Specifies an ExceptionListener to notify in case of a JMSException is thrown by the registered message listener or the invocation infrastructure. | no |
serverSessionFactory | ServerSessionFactory | server | Specifies the ServerSessionFactory to use. | no (defaults to SimpleServerSessionFactory ) |
SOAP consumer specific attributes
jms:soap-consumer
element.
Table A.5. Attributes for the JMS SOAP Consumer
Attribute | Type | Description | Required |
---|---|---|---|
wsdl | string | Specifies the WSDL describing the service. | yes |
useJbiWrapper | boolean | Specifies if the JBI wrapper is sent in the body of the message. | no (defaults to true ) |
validateWsdl | boolean | Specifies if the WSDL is checked WSI-BP compliance. | no (defaults to true ) |
policies | Policy[] | Specifies a list of interceptors used to process the message. | no |
A.3. Properties Specific to a JCA Consumer
jms:jca-consumer
element.
Table A.6. Elements Used to Configure a JCA Consumer
Element | Type | Description | Required |
---|---|---|---|
resourceAdapter | ResourceAdapter | Specifies the resource adapter used for the endpoint. | yes |
activationSpec | ActivationSpec | Specifies the activation information needed by the endpoint. | yes |
bootstrapContext | BootstrapContext | Specifies the bootstrap context used when starting the resource adapter. | no (a default one will be created) |
Appendix B. Provider Endpoint Properties
B.1. Common Properties
Attributes
Table B.1. Common Provider Endpoint Property Attributes
Attribute | Type | Description | Required |
---|---|---|---|
connectionFactory | string | Specifies a reference to the bean which configure the connection factory to be used by the endpoint. | yes |
deliveryMode | int | Specifies the JMS delivery mode. | no (defaults to persistent) |
destinationName | string | Specifies the JNDI name of the destination used to send messages. | no |
endpoint | string | Specifies the endpoint name of the proxied endpoint. | yes |
explicitQosEnabled | boolean | Specifies if the JMS messages have the specified properties explicitly applied. | no (defaults to false ) |
interfaceName | QName | Specifies the interface name of the proxied endpoint. | no |
jms102 | boolean | Specifies if the provider is to be JMS 1.0.2 compatible. | no (defaults to false ) |
messageIdEnabled | boolean | Specifies if JMS message IDs are enabled. | no (defaults to true ) |
messageTimeStampEnabled | boolean | Specifies if JMS messages are time stamped. | no (defaults to true ) |
priority | int | Specifies the priority assigned to the JMS messages. | no (defaults to 4 ) |
pubSubDomain | boolean | Specifies if the destination is a topic. | no (defaults to false |
pubSubNoLocal | boolean | Specifies if messages published by the listener's Connection are suppressed. | no (defaults to false ) |
recieveTimeout | long | Specifies the timeout for receiving a message in milliseconds. | no (defaults to unlimited) |
replyDestinationName | string | Specifies the JNDI name of the destination used to receive messages. | no |
service | QName | Specifies the service name of the proxied endpoint. | yes |
stateless | boolean | Specifies if the consumer retains state information about the message exchange while it is in process. | no (defaults to false ) |
timeToLive | long | Specifies the number of milliseconds the message is valid. | no (defaults to unlimited) |
Beans
Table B.2. Common Provider Endpoint Property Beans
Element | Type | Description | Required |
---|---|---|---|
destination | Destination | Specifies the JMS destination used to send messages. | no |
destinationChooser | DestinationChooser | Specifies a class implementing logic for choosing the JMS destinations. | no (defaults to SimpleDestinationChooser ) |
destinationResolver | DestinationResolver | Specifies a class implementing logic for converting strings into destination IDs. | no (defaults to DynamicDestinationResolver ) |
marshaler | JmsProviderMarshaler | Specifies the class implementing the message marshaler. | no (defaults to DefaultProviderMarshaler or JmsSoapProviderMarshaler ) |
replyDestination | Destination | Specifies the JMS destination used to receive messages. | no |
replyDestinationChooser | DestinationChooser | Specifies a class implementing logic for choosing the destination used to receive replies. | no (defaults to SimpleDestinationChooser ) |
storeFactory | StoreFactory | Specifies the factory class used to create the data store for state information. | no (defaults to MemoryStoreFactory ) |
store | Store | Specifies the data store used to store state information. | no |
B.2. Properties Specific to SOAP Providers
Attributes
jms:soap-provider
elements.
Table B.3. Attributes Used to Configure SOAP JMS Providers
Attribute | Type | Description | Required |
---|---|---|---|
useJbiWrapper | boolean | Specifies if the JBI wrapper is sent in the body of the message. | no (defaults to true ) |
validateWsdl | boolean | Specifies if the WSDL is checked for WSI-BP compliance. | no (defaults to true ) |
wsdl | string | Specifies the location of the WSDL describing the service. | yes |
Beans
jms:soap-provider
elements.
Table B.4. Elements Used to Configure SOAP JMS Providers
Element | Type | Description | Required |
---|---|---|---|
policies | Policy[] | Specifies a list of interceptors that will process the message. | no |
Appendix C. Using the Maven JBI Tooling
Abstract
- automatic generation of JBI descriptors
- dependency checking
- Set up a top-level project to build all of the service units and the final service assembly.
- Create a project for each of your service units..
- Create a project for the service assembly.
C.1. Setting up a Red Hat JBoss Fuse JBI project
Overview
- It allows you to control the dependencies for all of the parts of an application in a central location.
- It limits the number of times you need to specify the proper repositories to load.
- It provides you a central location from which to build and deploy the application.
Directory structure
- A source directory containing the information required for the Maven assembly plug-in
- A directory to store the service assembly project
- At least one directory containing a service unit projectTipYou will need a project folder for each service unit that is to be included in the generated service assembly.
Setting up the Maven tools
Example C.1. POM elements for using Red Hat JBoss Fuse Maven tooling
... <pluginRepositories> <pluginRepository> <id>fusesource.m2</id> <name>FuseSource Open Source Community Release Repository</name> <url>http://repo.fusesource.com/nexus/content/groups/public/</url> <snapshots> <enabled>false</enabled> </snapshots> <releases> <enabled>true</enabled> </releases> </pluginRepository> </pluginRepositories> <repositories> <repository> <id>fusesource.m2</id> <name>FuseSource Open Source Community Release Repository</name> <url>http://repo.fusesource.com/nexus/content/groups/public/</url> <snapshots> <enabled>false</enabled> </snapshots> <releases> <enabled>true</enabled> </releases> </repository> <repository> <id>fusesource.m2-snapshot</id> <name>FuseSource Open Source Community Snapshot Repository</name> <url>http://repo.fusesource.com/nexus/content/groups/public-snapshots/</url> <snapshots> <enabled>true</enabled> </snapshots> <releases> <enabled>false</enabled> </releases> </repository> </repositories> ... <build> <plugins> <plugin> <groupId>org.apache.servicemix.tooling</groupId> <artifactId>jbi-maven-plugin</artifactId> <version>servicemix-version</version> <extensions>true</extensions> </plugin> </plugins> </build> ...
Listing the sub-projects
modules
element. The modules
element contains one module
element for each service unit in the assembly. You also need a module
element for the service assembly.
Example JBI project pOM
Example C.2. Top-level POM for a Red Hat JBoss Fuse JBI project
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.widgets</groupId> <artifactId>demos</artifactId> <version>1.0</version> </parent> <groupId>com.widgets.demo</groupId> <artifactId>cxf-wsdl-first</artifactId> <name>CXF WSDL Fisrt Demo</name> <packaging>pom</packaging> <pluginRepositories> 1 <pluginRepository> <id>fusesource.m2</id> <name>FuseSource Open Source Community Release Repository</name> <url>http://repo.fusesource.com/nexus/content/groups/public/</url> <snapshots> <enabled>false</enabled> </snapshots> <releases> <enabled>true</enabled> </releases> </pluginRepository> </pluginRepositories> <repositories> <repository> <id>fusesource.m2</id> <name>FuseSource Open Source Community Release Repository</name> <url>http://repo.fusesource.com/nexus/content/groups/public/</url> <snapshots> <enabled>false</enabled> </snapshots> <releases> <enabled>true</enabled> </releases> </repository> <repository> <id>fusesource.m2-snapshot</id> <name>FuseSource Open Source Community Snapshot Repository</name> <url>http://repo.fusesource.com/nexus/content/groups/public-snapshots/</url> <snapshots> <enabled>true</enabled> </snapshots> <releases> <enabled>false</enabled> </releases> </repository> </repositories> <modules> 2 <module>wsdl-first-cxfse-su</module> <module>wsdl-first-cxf-sa</module> </modules> <build> <plugins> <plugin> 3 <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.1</version> <inherited>false</inherited> <executions> <execution> <id>src</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <descriptors> <descriptor>src/main/assembly/src.xml</descriptor> </descriptors> </configuration> </execution> </executions> </plugin> <plugin> 4 <groupId>org.apache.servicemix.tooling</groupId> <artifactId>jbi-maven-plugin</artifactId> <extensions>true</extensions> </plugin> </plugins> </build> </project>
- 1
- Configures Maven to use the FuseSource repositories for loading the JBoss Fuse plug-ins.
- 2
- Lists the sub-projects used for this application. The
wsdl-first-cxfse-su
module is the module for the service unit. Thewsdl-first-cxf-sa
module is the module for the service assembly - 3
- Configures the Maven assembly plug-in.
- 4
- Loads the JBoss Fuse JBI plug-in.
C.2. A service unit project
Overview
Seeding a project using a Maven artifact
groupId
value and the artifactId
values correspond to the project's group ID and artifact ID.
Example C.3. Maven archetype command for service units
smx-arch
su suArchetypeName
[
"-DgroupId=my.group.id"
] [
"-DartifactId=my.artifact.id"
]
"
) are required when using the -DgroupId
argument and the -DartifactId
argument.
Table C.1. Service unit archetypes
Name | Description |
---|---|
camel | Creates a project for using the Apache Camel service engine |
cxf-se | Creates a project for developing a Java-first service using the Apache CXF service engine |
cxf-se-wsdl-first | Creates a project for developing a WSDL-first service using the Apache CXF service engine |
cxf-bc | Creates an endpoint project targeted at the Apache CXF binding component |
http-consumer | Creates a consumer endpoint project targeted at the HTTP binding component |
http-provider | Creates a provider endpoint project targeted at the HTTP binding component |
jms-consumer | Creates a consumer endpoint project targeted at the JMS binding component (see Using the JMS Binding Component) |
jms-provider | Creates a provider endpoint project targeted at the JMS binding component (see Using the JMS Binding Component) |
file-poller | Creates a polling (consumer) endpoint project targeted at the file binding component (see chapter "Using Poller Endpoints" in "Using the File Binding Component") |
file-sender | Creates a sender (provider) endpoint project targeted at the file binding component (see chapter "Using Sender Endpoints" in "Using the File Binding Component") |
ftp-poller | Creates a polling (consumer) endpoint project targeted at the FTP binding component |
ftp-sender | Creates a sender (provider) endpoint project targeted at the FTP binding component |
jsr181-annotated | Creates a project for developing an annotated Java service to be run by the JSR181 service engine [a] |
jsr181-wsdl-first | Creates a project for developing a WSDL generated Java service to be run by the JSR181 service engine [a] |
saxon-xquery | Creates a project for executing xquery statements using the Saxon service engine |
saxon-xslt | Creates a project for executing XSLT scripts using the Saxon service engine |
eip | Creates a project for using the EIP service engine. [b] |
lwcontainer | Creates a project for deploying functionality into the lightweight container [c] |
bean | Creates a project for deploying a POJO to be executed by the bean service engine |
ode | Create a project for deploying a BPEL process into the ODE service engine |
[a]
The JSR181 has been deprecated. The Apache CXF service engine has superseded it.
[b]
The EIP service engine has been deprecated. The Apache Camel service engine has superseded it.
[c]
The lightweight container has been deprecated.
|
Contents of a project
- a POM file that configures the JBI plug-in to create a service unit
- an XML configuration file stored in
src/main/resources
For many of the components, the XML configuration file is calledxbean.xml
. The Apache Camel component uses a file calledcamel-context.xml
.
Configuring the Maven plug-in
packaging
element to jbi-service-unit
as shown in Example C.4.
Example C.4. Configuring the maven plug-in to build a service unit
<project ...>
<modelVersion>4.0.0</modelVersion>
...
<groupId>com.widgets.demo.cxf-wsdl-first</groupId>
<artifactId>cxfse-wsdl-first-su</artifactId>
<name>CXF WSDL Fisrt Demo :: SE Service Unit</name>
<packaging>jbi-service-unit</packaging>
...
</project>
Specifying the target components
- List the targeted component as a dependency
- Add a
componentName
property specifying the targeted component
- Add a
componentName
property specifying the targeted component. - Add the remaining components to the list dependencies.
Example C.5. Specifying the target components for a service unit
... <dependencies> <dependency> <groupId>org.apache.servicemix</groupId> <artifactId>servicemix-cxf-bc</artifactId> <version>3.3.1.0-fuse</version>[2] </dependency> >/dependencies> ...
componentName
element. This element is added to the standard Maven properties block and it specifies the name of a targeted component, as specified in Example C.6.
Example C.6. Specifying a target component for a service unit
... <properties> <componentName>servicemix-bean</componentName> </properties> ...
componentName
element, Maven does not check to see if the component is installed, nor does it download the required component.
Example
Example C.7. POM file for a service unit project
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> 1 <groupId>com.widgets.demo</groupId> <artifactId>cxf-wsdl-first</artifactId> <version>1.0</version> </parent> <groupId>com.widgets.demo.cxf-wsdl-first</groupId> <artifactId>cxfse-wsdl-first-su</artifactId> <name>CXF WSDL Fisrt Demo :: SE Service Unit</name> <packaging>jbi-service-unit</packaging> 2 <dependencies> 3 <dependency> <groupId>org.apache.servicemix</groupId> <artifactId>servicemix-cxf-bc</artifactId> <version>3.3.1.0-fuse</version> </dependency> >/dependencies> <build> <plugins> <plugin> 4 <groupId>org.apache.servicemix.tooling</groupId> <artifactId>jbi-maven-plugin</artifactId> <extensions>true</extensions> </plugin> </plugins> </build> </project>
- 1
- Specifies that it is a part of the top-level project shown in Example C.2, “Top-level POM for a Red Hat JBoss Fuse JBI project”
- 2
- Specifies that this project builds a service unit
- 3
- Specifies that the service unit targets the Apache CXF binding component
- 4
- Specifies to use the Red Hat JBoss Fuse Maven plug-in
C.3. A service assembly project
Overview
Seeding a project using a Maven artifact
groupId
value and the artifactId
values, which correspond to the project's group ID and artifact ID.
Example C.8. Maven archetype command for service assemblies
smx-arch
sa
[
"-DgroupId=my.group.id"
] [
"-DartifactId=my.artifact.id"
]
-DgroupId
argument and the -DartifactId
argument.
Contents of a project
Configuring the Maven plug-in
packaging
element to jbi-service-assembly
, as shown in Example C.9.
Example C.9. Configuring the Maven plug-in to build a service assembly
<project ...>
<modelVersion>4.0.0</modelVersion>
...
<groupId>com.widgets.demo.cxf-wsdl-first</groupId>
<artifactId>cxf-wsdl-first-sa</artifactId>
<name>CXF WSDL Fisrt Demo :: Service Assembly</name>
<packaging>jbi-service-assembly</packaging>
...
</project>
Specifying the target components
dependencies
element. Add a dependency
child element for each service unit. Example C.10 shows the configuration for a service assembly that bundles two service units.
Example C.10. Specifying the target components for a service unit
... <dependencies> <dependency> <groupId>com.widgets.demo.cxf-wsdl-first</groupId> <artifactId>cxfse-wsdl-first-su</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>com.widgets.demo.cxf-wsdl-first</groupId> <artifactId>cxfbc-wsdl-first-su</artifactId> <version>1.0</version> </dependency> </dependencies> ...
Example
Example C.11. POM for a service assembly project
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> 1 <groupId>com.widgets.demo</groupId> <artifactId>cxf-wsdl-first</artifactId> <version>1.0</version> </parent> <groupId>com.widgets.demo.cxf-wsdl-first</groupId> <artifactId>cxf-wsdl-first-sa</artifactId> <name>CXF WSDL Fisrt Demo :: Service Assemby</name> <packaging>jbi-service-assembly</packaging> 2 <dependencies> 3 <dependency> <groupId>com.widgets.demo.cxf-wsdl-first</groupId> <artifactId>cxfse-wsdl-first-su</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>com.widgets.demo.cxf-wsdl-first</groupId> <artifactId>cxfbc-wsdl-first-su</artifactId> <version>1.0</version> </dependency> </dependencies> <build> <plugins> <plugin> 4 <groupId>org.apache.servicemix.tooling</groupId> <artifactId>jbi-maven-plugin</artifactId> <extensions>true</extensions> </plugin> </plugins> </build> </project>
- 1
- Specifies that it is a part of the top-level project shown in Example C.2, “Top-level POM for a Red Hat JBoss Fuse JBI project”
- 2
- Specifies that this project builds a service assembly
- 3
- Specifies the service units being bundled by the service assembly
- 4
- Specifies to use the JBoss Fuse Maven plug-in
Appendix D. Using the Maven OSGi Tooling
Abstract
D.1. Setting up a Red Hat JBoss Fuse OSGi project
Overview
Directory structure
src
folder. As in all Maven projects, you place all Java source code in the src/java
folder, and you place any non-Java resources in the src/resources
folder.
beans.xml
file located in the src/resources/META-INF/spring
folder.
Adding a bundle plug-in
Example D.1. Adding an OSGi bundle plug-in to a POM
... <dependencies> <dependency> 1 <groupId>org.apache.felix</groupId> <artifactId>org.osgi.core</artifactId> <version>1.0.0</version> </dependency> ... </dependencies> ... <build> <plugins> <plugin> 2 <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <configuration> <instructions> <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> 3 <Import-Package>*,org.apache.camel.osgi</Import-Package> 4 <Private-Package>org.apache.servicemix.examples.camel</Private-Package> 5 </instructions> </configuration> </plugin> </plugins> </build> ...
- 1
- Adds the dependency on Apache Felix
- 2
- Adds the bundle plug-in to your project
- 3
- Configures the plug-in to use the project's artifact ID as the bundle's symbolic name
- 4
- Configures the plug-in to include all Java packages imported by the bundled classes; also imports the org.apache.camel.osgi package
- 5
- Configures the plug-in to bundle the listed class, but not to include them in the list of exported packages
Activating a bundle plug-in
packaging
element to bundle
.
Useful Maven archetypes
Spring OSGi archetype
org.springframework.osgi/spring-bundle-osgi-archetype/1.1.2
mvn archetype:create -DarchetypeGroupId=org.springframework.osgi -DarchetypeArtifactId=spring-osgi-bundle-archetype -DarchetypeVersion=1.12 -DgroupId=groupId -DartifactId=artifactId -Dversion=version
Apache CXF code-first archetype
org.apache.servicemix.tooling/servicemix-osgi-cxf-code-first-archetype/2008.01.0.3-fuse
mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=spring-osgi-bundle-archetype -DarchetypeVersion=2008.01.0.3-fuse -DgroupId=groupId -DartifactId=artifactId -Dversion=version
Apache CXF wsdl-first archetype
org.apache.servicemix.tooling/servicemix-osgi-cxf-wsdl-first-archetype/2008.01.0.3-fuse
mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=servicemix-osgi-cxf-wsdl-first-archetype -DarchetypeVersion=2008.01.0.3-fuse -DgroupId=groupId -DartifactId=artifactId -Dversion=version
Apache Camel archetype
org.apache.servicemix.tooling/servicemix-osgi-camel-archetype/2008.01.0.3-fuse
mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=servicemix-osgi-camel-archetype -DarchetypeVersion=2008.01.0.3-fuse -DgroupId=groupId -DartifactId=artifactId -Dversion=version
D.2. Configuring the Bundle Plug-In
Overview
instructions
element.
Configuration properties
Setting a bundle's symbolic name
+ "." +
artifactId, with the following exceptions:
- If groupId has only one section (no dots), the first package name with classes is returned.For example, if the group Id is
commons-logging:commons-logging
, the bundle's symbolic name isorg.apache.commons.logging
. - If artifactId is equal to the last section of groupId, then groupId is used.For example, if the POM specifies the group ID and artifact ID as
org.apache.maven:maven
, the bundle's symbolic name isorg.apache.maven
. - If artifactId starts with the last section of groupId, that portion is removed.For example, if the POM specifies the group ID and artifact ID as
org.apache.maven:maven-core
, the bundle's symbolic name isorg.apache.maven.core
.
Bundle-SymbolicName
child in the plug-in's instructions
element, as shown in Example D.2.
Example D.2. Setting a bundle's symbolic name
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
...
</instructions>
</configuration>
</plugin>
Setting a bundle's name
${project.name}
.
Bundle-Name
child to the plug-in's instructions
element, as shown in Example D.3.
Example D.3. Setting a bundle's name
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-Name>JoeFred</Bundle-Name>
...
</instructions>
</configuration>
</plugin>
Setting a bundle's version
${project.version}
. Any dashes (-
) are replaced with dots (.
) and the number is padded up to four digits. For example, 4.2-SNAPSHOT
becomes 4.2.0.SNAPSHOT
.
Bundle-Version
child to the plug-in's instructions
element, as shown in Example D.4.
Example D.4. Setting a bundle's version
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-Version>1.0.3.1</Bundle-Version>
...
</instructions>
</configuration>
</plugin>
Specifying exported packages
Export-Package
list is populated by all of the packages in your local Java source code (under src/main/java
), except for the deault package, .
, and any packages containing .impl
or .internal
.
Private-Package
element in your plug-in configuration and you do not specify a list of packages to export, the default behavior includes only the packages listed in the Private-Package
element in the bundle. No packages are exported.
Export-Package
child to the plug-in's instructions
element.
Export-Package
element specifies a list of packages that are to be included in the bundle and that are to be exported. The package names can be specified using the *
wildcard symbol. For example, the entry com.fuse.demo.*
includes all packages on the project's classpath that start with com.fuse.demo.
!
. For example, the entry !com.fuse.demo.private
excludes the package com.fuse.demo.private.
!com.fuse.demo.private,com.fuse.demo.*
Specifying private packages
Private-Package
instruction to the bundle plug-in configuration. By default, if you do not specify a Private-Package
instruction, all packages in your local Java source are included in the bundle.
Private-Package
element and the Export-Package
element, the Export-Package
element takes precedence. The package is added to the bundle and exported.
Private-Package
element works similarly to the Export-Package
element in that you specify a list of packages to be included in the bundle. The bundle plug-in uses the list to find all classes on the project's classpath that are to be included in the bundle. These packages are packaged in the bundle, but not exported (unless they are also selected by the Export-Package
instruction).
Example D.5. Including a private package in a bundle
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Private-Package>org.apache.cxf.wsdlFirst.impl</Private-Package>
...
</instructions>
</configuration>
</plugin>
Specifying imported packages
Import-Package
property with a list of all the packages referred to by the contents of the bundle.
Import-Package
child to the plug-in's instructions
element. The syntax for the package list is the same as for the Export-Package
element and the Private-Package
element.
Import-Package
element, the plug-in does not automatically scan the bundle's contents to determine if there are any required imports. To ensure that the contents of the bundle are scanned, you must place an *
as the last entry in the package list.
Example D.6. Specifying the packages imported by a bundle
<plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <configuration> <instructions> <Import-Package>javax.jws, javax.wsdl, org.apache.cxf.bus, org.apache.cxf.bus.spring, org.apache.cxf.bus.resource, org.apache.cxf.configuration.spring, org.apache.cxf.resource, org.springframework.beans.factory.config, * </Import-Package> ... </instructions> </configuration> </plugin>
More information
Index
A
- AMQPool, Using Apache ActiveMQ Connection Factories
- JCA, JCA pool
- simple, Simple pool
- XA, XA pool
- amqpool:jca-pool, JCA pool
- amqpool:pool, Simple pool
- id, Simple pool
- maxConnections, Simple pool
- maximumActive, Simple pool
- url, Simple pool
- amqpool:xa-pool, XA pool
B
- Bundle-Name, Setting a bundle's name
- Bundle-SymbolicName, Setting a bundle's symbolic name
- Bundle-Version, Setting a bundle's version
- bundles
- exporting packages, Specifying exported packages
- importing packages, Specifying imported packages
- name, Setting a bundle's name
- private packages, Specifying private packages
- symbolic name, Setting a bundle's symbolic name
- version, Setting a bundle's version
C
- componentName, Specifying the target components
- connection factory
- AMQPool (see AMQPool)
- Apache ActiveMQ, Using Apache ActiveMQ Connection Factories
- pooled (see AMQPool)
- ConnectionFactory, Procedure, Procedure, Procedure
- consumer, Types of consumer endpoints
- cacheLevel, Performace tuning using the listener container
- clientId, Performace tuning using the listener container
- concurrentConsumers, Performace tuning using the listener container
- connectionFactory, Procedure
- destination, Configuring a destination
- destinationChooser, Determining the reply destination, Configuring an endpoint to use a destination chooser
- destinationName, Configuring a destination
- destinationResolver, Configuring an endpoint to use a destination resolver
- durableSubscriberName, Using durable subscriptions
- endpoint, Procedure
- generic, Types of consumer endpoints
- JCA, Types of consumer endpoints
- jms102, Procedure
- listenerType, Specifying an endpoint's listener container
- marshaler, Configuring the consumer
- maxMessagesPerTask, Performace tuning using the listener container
- messageSelector, Using message selectors
- pubSubDomaim, Procedure
- receiveTimeout, Performace tuning using the listener container
- recoveryInterval, Performace tuning using the listener container
- replyDeliveryMode, Setting the reply message's persistence
- replyDestination, Determining the reply destination
- replyDestinationName, Determining the reply destination
- replyExplicitQosEnabled, Enforcing the configured values
- replyPriority, Setting the reply message's priority
- replyProperties, Setting custom JMS header properties
- replyTimeToLive, Setting a reply message's lifespan
- serverSessionFactory, Configuring the server session listener container's session factory
- service, Procedure
- soap, Types of consumer endpoints
- stateless, Activating statefullness
- storeFactory, Configuring the datastore
- subscriptionDurable, Using durable subscriptions
- targetEndpoint, Specifying the target endpoint
- targetInterface, Specifying the target endpoint
- targetService, Specifying the target endpoint
- transacted, Using transactions
- consumer endpoint
D
- DefaultConsumerMarshaler, Overview
- DefaultProviderMarshaler, Overview
- delivery mode, Setting the reply message's persistence, Setting a message's persistence
- destination chooser, Determining the reply destination
- implementing, Implementing a destination chooser
- destination resolver
- configuration, Configuring an endpoint to use a destination resolver
- implementing, Implementing a destination resolver
- DestinationChooser, Configuring a destination, Configuring the response destination, Implementing a destination chooser
- destinationChooser, Configuring an endpoint to use a destination chooser
- DestinationResolver, Implementing a destination resolver
- destinationResolver, Configuring an endpoint to use a destination resolver
- durable subscriptions, Using durable subscriptions
E
- Export-Package, Specifying exported packages
I
- Import-Package, Specifying imported packages
J
- java.util.Map, Defining the property map
- JBI wrapper, Using the JBI wrapper, Using the JBI wrapper
- jbi.xml, Contents of a JMS service unit
- jca-consumer, Types of consumer endpoints
- activationSpec, Procedure
- connectionFactory, Procedure
- destination, Configuring a destination
- destinationChooser, Determining the reply destination, Configuring an endpoint to use a destination chooser
- destinationName, Configuring a destination
- destinationResolver, Configuring an endpoint to use a destination resolver
- endpoint, Procedure
- marshaler, Configuring the consumer
- pubSubDomaim, Procedure
- replyDeliveryMode, Setting the reply message's persistence
- replyDestination, Determining the reply destination
- replyDestinationName, Determining the reply destination
- replyExplicitQosEnabled, Enforcing the configured values
- replyPriority, Setting the reply message's priority
- replyProperties, Setting custom JMS header properties
- replyTimeToLive, Setting a reply message's lifespan
- resourceAdapter, Procedure
- service, Procedure
- stateless, Activating statefullness
- storeFactory, Configuring the datastore
- targetEndpoint, Specifying the target endpoint
- targetInterface, Specifying the target endpoint
- targetService, Specifying the target endpoint
- JdbcStore, Configuring the datastore
- JdbcStoreFactory, Configuring the datastore
- jee:environment, Spring JEE JNDI lookup
- jee:jndi-lookup, Spring JEE JNDI lookup
- id, Spring JEE JNDI lookup
- jndi-name, Spring JEE JNDI lookup
- Jencks AMQPool (see AMQPool)
- JmsConsumerMarshaler, Implementing the marshaler
- JMSDeliveryMode, Setting the reply message's persistence, Setting a message's persistence
- JMSExpirary, Setting a reply message's lifespan, Setting a message's life span
- JMSPriority, Setting the reply message's priority, Setting a message's priority
- JmsProviderMarshaler, Implementing the marshaler
- JmsSoapConsumerMarshaler, Overview
- JmsSoapProviderMarshaler, Overview
- JndiObjectFactoryBean, Spring JNDI Templates
- JndiTemplate, Spring JNDI Templates
L
- listener container
M
- map, Defining the property map
- marshaler, Configuring the consumer
- Maven archetypes, Useful Maven archetypes
- Maven tooling
- adding the bundle plug-in, Adding a bundle plug-in
- servicemix-jms-consumer-endpoint, Using the Maven JBI tooling
- servicemix-jms-provider-endpoint, Using the Maven JBI tooling
- set up, Setting up the Maven tools
- MemoryStore, Configuring the datastore
- message persistence, Setting the reply message's persistence, Setting a message's persistence
- message priority, Setting a message's priority
- message selectors, Using message selectors
P
- persistence, Setting the reply message's persistence, Setting a message's persistence
- priority, Setting a message's priority
- Private-Package, Specifying private packages
- provider, Types of providers
- connectionFactory, Procedure
- deliveryMode, Setting a message's persistence
- destination, Configuring a destination
- destinationChooser, Configuring a destination, Configuring the response destination, Configuring an endpoint to use a destination chooser
- destinationName, Configuring a destination
- destinationResolver, Configuring an endpoint to use a destination resolver
- endpoint, Procedure
- explicitQosEnabled, Enforcing configured values
- generic, Types of providers
- jms102, Procedure
- marshaler, Configuring the provider
- messageIdEnabled, Message IDs
- messageTimeStampEnabled, Time stamps
- priority, Setting a message's priority
- pubSubDomaim, Procedure
- recieveTimeout, Configuring the timeout interval
- replyDestination, Configuring the response destination
- replyDestinationName, Configuring the response destination
- service, Procedure
- soap, Types of providers
- stateless, Activating statefullness
- storeFactory, Configuring the datastore
- timeToLive, Setting a message's life span
- provider endpoint
- connection factory, Procedure
R
- replyProperties, Setting custom JMS header properties
S
- service assembly
- seeding, Seeding a project using a Maven artifact
- specifying the service units, Specifying the target components
- service unit
- seeding, Seeding a project using a Maven artifact
- specifying the target component, Specifying the target components
- smx-arch, Seeding a project using a Maven artifact, Seeding a project using a Maven artifact
- soap-consumer, Types of consumer endpoints
- cacheLevel, Performace tuning using the listener container
- clientId, Performace tuning using the listener container
- concurrentConsumers, Performace tuning using the listener container
- connectionFactory, Procedure
- destination, Configuring a destination
- destinationChooser, Determining the reply destination, Configuring an endpoint to use a destination chooser
- destinationName, Configuring a destination
- destinationResolver, Configuring an endpoint to use a destination resolver
- durableSubscriberName, Using durable subscriptions
- endpoint, Procedure
- jms102, Procedure
- listenerType, Specifying an endpoint's listener container
- marshaler, Configuring the consumer
- maxMessagesPerTask, Performace tuning using the listener container
- messageSelector, Using message selectors
- pubSubDomaim, Procedure
- receiveTimeout, Performace tuning using the listener container
- recoveryInterval, Performace tuning using the listener container
- replyDeliveryMode, Setting the reply message's persistence
- replyDestination, Determining the reply destination
- replyDestinationName, Determining the reply destination
- replyExplicitQosEnabled, Enforcing the configured values
- replyPriority, Setting the reply message's priority
- replyProperties, Setting custom JMS header properties
- replyTimeToLive, Setting a reply message's lifespan
- serverSessionFactory, Configuring the server session listener container's session factory
- service, Procedure
- stateless, Activating statefullness
- storeFactory, Configuring the datastore
- subscriptionDurable, Using durable subscriptions
- targetEndpoint, Specifying the target endpoint
- targetInterface, Specifying the target endpoint
- targetService, Specifying the target endpoint
- transacted, Using transactions
- useJbiWrapper, Using the JBI wrapper
- validateWsdl, WSDL verification
- wsdl, Procedure
- soap-provider, Types of providers
- connectionFactory, Procedure
- deliveryMode, Setting a message's persistence
- destination, Configuring a destination
- destinationChooser, Configuring a destination, Configuring the response destination, Configuring an endpoint to use a destination chooser
- destinationName, Configuring a destination
- destinationResolver, Configuring an endpoint to use a destination resolver
- endpoint, Procedure
- explicitQosEnabled, Enforcing configured values
- jms102, Procedure
- marshaler, Configuring the provider
- messageIdEnabled, Message IDs
- messageTimeStampEnabled, Time stamps
- priority, Setting a message's priority
- pubSubDomaim, Procedure
- recieveTimeout, Configuring the timeout interval
- replyDestination, Configuring the response destination
- replyDestinationName, Configuring the response destination
- service, Procedure
- stateless, Activating statefullness
- storeFactory, Configuring the datastore
- timeToLive, Setting a message's life span
- useJbiWrapper, Using the JBI wrapper
- validateWsdl, WSDL verification
- wsdl, Procedure
- Spring map, Defining the property map
T
- time to live, Setting a message's life span
- transactions, Using transactions
U
- util:map, Defining the property map
W
- WS-I basic profile, WSDL verification, WSDL verification
X
- xbean.xml, Contents of a JMS service unit
Legal Notice
Trademark Disclaimer
Legal Notice
Third Party Acknowledgements
- JLine (http://jline.sourceforge.net) jline:jline:jar:1.0License: BSD (LICENSE.txt) - Copyright (c) 2002-2006, Marc Prud'hommeaux
mwp1@cornell.edu
All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of JLine nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - Stax2 API (http://woodstox.codehaus.org/StAX2) org.codehaus.woodstox:stax2-api:jar:3.1.1License: The BSD License (http://www.opensource.org/licenses/bsd-license.php)Copyright (c) <YEAR>, <OWNER> All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - jibx-run - JiBX runtime (http://www.jibx.org/main-reactor/jibx-run) org.jibx:jibx-run:bundle:1.2.3License: BSD (http://jibx.sourceforge.net/jibx-license.html) Copyright (c) 2003-2010, Dennis M. Sosnoski.All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of JiBX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - JavaAssist (http://www.jboss.org/javassist) org.jboss.javassist:com.springsource.javassist:jar:3.9.0.GA:compileLicense: MPL (http://www.mozilla.org/MPL/MPL-1.1.html)
- HAPI-OSGI-Base Module (http://hl7api.sourceforge.net/hapi-osgi-base/) ca.uhn.hapi:hapi-osgi-base:bundle:1.2License: Mozilla Public License 1.1 (http://www.mozilla.org/MPL/MPL-1.1.txt)