Red Hat Training

A Red Hat training course is available for JBoss Enterprise SOA Platform

Chapter 5. Building and Using Services

5.1. Message Listener Configuration Properties

Each listener configuration needs to supply information for:
  • the registry (see the service-category, service-name, service-description and EPR-description tag names.) If you set the optional remove-old-service tag name to true, the Enterprise Service Bus will remove any pre-existing service entry from the registry and then add this new instance. Always use this functionality with care as the entire service will be removed, including every end-point reference.
  • the instantiation of the listener class (see the listenerClass tag name).
  • the endpoint reference that the listener will service. This is transport-specific. The following example corresponds to a Java Message Service endpoint reference (see the connection-factory, destination-type, destination-name, jndi-type, jndi-URL and message-selector tag names).
  • the action pipeline. This needs one or more <action> elements, each of which must contain the class tag name. These will determine which action class will be instantiated for that link in the chain.
  <?xml version = "1.0" encoding = "UTF-8"?>
<jbossesb xmlns="" parameterReloadSecs="5">

  <jms-provider name="JBossMQ" 
    <jms-bus busid="quickstartGwChannel">
      <jms-message-filter dest-type="QUEUE" 
    <jms-bus busid="quickstartEsbChannel">
      <jms-message-filter dest-type="QUEUE"
  <service category="FirstServiceESB" 
    name="SimpleListener" description="Hello World">
      <jms-listener name="JMS-Gateway" 
        busidref="quickstartGwChannel" maxThreads="1"
      <jms-listener name="helloWorld"
        busidref="quickstartEsbChannel" maxThreads="1"/>

      <action name="action1" class="org.jboss.soa.esb.samples.
        process="displayMessage" />
      <action name="notificationAction" 
        <property name="okMethod" value="notifyOK" />
        <property name="notification-details"> 
          <NotificationList type="ok">
            <target class="NotifyConsole"/>
          <NotificationList type="err">
            <target class="NotifyConsole"/>

This example configuration instantiates a listener object (the jms-listener tag), which will wait for those incoming ESB messages that are serialized within an interface. It then delivers each incoming message to an action pipeline consisting of two steps (<action> elements):
  1. action1: MyJMSListenerAction (an example follows).
  2. notificationAction: an org.jboss.soa.esb.actions.SystemPrintln class.
The reason there are two listeners is that the gateway listener is the ESB-unaware listener and its role is to encapsulate the JMS message in the ESB message used throughout the enterprise service bus.