Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.3.2. Using the Generic Endpoint or the SOAP Endpoint
3.2.1. Basic Configuration Copy linkLink copied to clipboard!
Procedure Copy linkLink copied to clipboard!
- 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
serviceattribute.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
endpointattribute.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
connectionFactoryattribute. TheconnectionFactoryattribute'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 theconnectionFactoryattribute 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
wsdlattribute. - If your JMS destination is a topic, set the
pubSubDomaimattribute totrue. - If your endpoint is interacting with a broker that only supports JMS 1.0.2, set the
jms102attribute totrue.
Configuring a destination Copy linkLink copied to clipboard!
- 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:destinationchild element. You can also configure the bean separately and refer the bean using the endpoint'sdestinationattribute as shown in Example 3.1, “Configuring a Consumer's Destination”.Example 3.1. Configuring a Consumer's Destination
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - If you did not explicitly configure a destination, the endpoint will use the value of the
destinationNameattribute to choose its destination.The value of thedestinationNameattribute 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 customDestinationResolverimplementation. See Section 7.2, “Using a Custom Destination Resolver”.
Specifying the target endpoint Copy linkLink copied to clipboard!
- If you explicitly specify an endpoint using both the
targetServiceattribute and thetargetEndpointattribute, the ESB will use that endpoint.ThetargetServiceattribute specifies the QName of a service deployed into the ESB. ThetargetEndpointattribute specifies the name of an endpoint deployed by the service specified by thetargetServiceattribute. - If you only specify a value for the
targetServiceattribute, 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
targetInterfaceattribute. 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 thenameattribute of either a WSDL 1.1serviceTypeelement or a WSDL 2.0interfaceelement.
Examples Copy linkLink copied to clipboard!
Example 3.2. Basic Configuration for a Generic Consumer Endpoint
Example 3.3. Basic Configuration for a SOAP Consumer Endpoint
3.2.2. Listener Containers Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
Types of listener containers Copy linkLink copied to clipboard!
- 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
ServerSessionPoolSPI 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 JMSServerSessionPoolSPI.
Specifying an endpoint's listener container Copy linkLink copied to clipboard!
listenerType attribute. Table 3.1, “Values for Configuring a Consumer's Listener Container” lists the values for the listenerType attribute.
Example 3.4. Configuring a SOAP Consumer to Use the Simple Listener Container
Performace tuning using the listener container Copy linkLink copied to clipboard!
Example 3.5. Tuning a Generic Consumer Endpoint
Configuring the server session listener container's session factory Copy linkLink copied to clipboard!
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
3.2.3. Advanced Configuration Copy linkLink copied to clipboard!
Using transactions Copy linkLink copied to clipboard!
transacted attribute to specify the type of transactions to use. Table 3.3, “Consumer Transaction Support” describes the possible values for the transacted attribute.
| 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 Copy linkLink copied to clipboard!
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 Copy linkLink copied to clipboard!
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
3.2.4. SOAP Specific Configuration Copy linkLink copied to clipboard!
Overview Copy linkLink copied to clipboard!
Using the JBI wrapper Copy linkLink copied to clipboard!
useJbiWrapper attribute to true.
Example 3.8. Configuring a SOAP Consumer to Use the JBI Wrapper
WSDL verification Copy linkLink copied to clipboard!
validateWsdl attribute to false.