1 Reply Latest reply on Aug 21, 2008 10:24 AM by Mike Trzcianowski

    How do you link gateway channels to non-gateway channels?

    Alexandros Karypidis Novice

      Hello,

      This is a rather simple newbie question regarding JBossESB.

      I understand that JBossESB gateway listeners convert incoming messages to JBossESB's internal format (defined in message.xsd) and then forward them to "ESB-aware" channels.

      As far as I can see, services must have at least one ESB-aware listener. Otherwise deployment fails with JBossESB complaining about the lack of an ESB-aware listener. So far so good.

      Now, in the jboss-esb.xml file, the only thing I'm aware of that links the gateway listeners to the non-gateway listener is the fact that they are declared within the "listeners" element as follows:

      <listeners>
       <sql-listener name="SQL-Gateway"
       busidref="mySQLChannel"
       is-gateway="true"
       poll-frequency-seconds="5" />
       <fs-listener name="FS-Gateway"
       schedule-frequency="5"
       is-gateway="true"
       busidref="myFilesystemChannel" />
       <jms-listener name="JMS-Gateway"
       busidref="quickstartGwChannel" is-gateway="true" />
       <jms-listener name="helloWorld"
       busidref="quickstartEsbChannel" />
      </listeners>


      So, my assumption is that all non-gateway listeners forward their message to the esb-aware listener alongside which they are defined. Is that correct?

      In any case, I tried to define two ESB-aware listeners (as follows) and found out that JBossESB does not complain:

      <listeners>
       <sql-listener name="SQL-Gateway"
       busidref="mySQLChannel"
       is-gateway="true"
       poll-frequency-seconds="5" />
       <fs-listener name="FS-Gateway"
       schedule-frequency="5"
       is-gateway="true"
       busidref="myFilesystemChannel" />
       <jms-listener name="JMS-Gateway"
       busidref="quickstartGwChannel" is-gateway="true" />
       <jms-listener name="helloWorld"
       busidref="quickstartEsbChannel" />
       <jms-listener name="helloWorld2"
       busidref="quickstartEsbChannel2" />
      </listeners>


      I would've expected JBossESB to complain that there are multiple non-gateway listeners defined, but everything worked like a charm.

      So, what is the logic behind this? How are the two kinds of listeners associated with each other?


        • 1. Re: How do you link gateway channels to non-gateway channels
          Mike Trzcianowski Newbie

          I'm not an expert at this but from what I can see, the ESB will load-balance the message across all the ESB-aware listeners.

          I setup a Service with a System.Println action, one gateway listener and two ESB-aware listeners. What I noticed is that if I send a bunch messages to the gateway, half of the messages would go the the 1st esb-aware listener and half of the messages would go to the other esb-aware listener.

          I'm assuming this functionality is configurable somewhere.