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?