Chapter 3. Creating a Consumer Endpoint
Abstract
A consumer is an endpoint that listens for messages, passes the messages to the NMR, and sends any response that maybe generated back to the external JMS endpoint. They are built using the Spring framework's JMS
MessageListener
interface.
Important
The Java Business Integration components of Red Hat JBoss Fuse are considered deprecated. You should consider migrating any JBI applications to OSGi.
3.1. Introduction to Consumer Endpoints
Where does a consumer fit into a solution?
Consumer endpoints play the role of consumer from the vantage point of the other endpoints in the ESB. As shown in Figure 3.1, “Consumer Endpoint”,consumer endpoints listen for messages on a JMS destination. When the message is received, the consumer endpoint passes it onto the NMR for delivery. If the JMS message is part of an in-out message exchange, the consumer endpoint will place that message into a reply destination for delivery to the originator of the JMS message.
Figure 3.1. Consumer Endpoint
![consumer endpoint in a message exchange](https://access.redhat.com/webassets/avalon/d/Red_Hat_JBoss_Fuse-6.0-Using_the_JMS_Binding_Component-en-US/images/28e44d9a2a2d1eb416980ac425e298bf/jmsconsumer.gif)
Types of consumer endpoints
The JMS binding component offers three 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”.