14 Replies Latest reply on Sep 29, 2009 7:39 AM by arjun purushothaman

    Problem with Message routing in ESB

    arjun purushothaman Newbie

      Hi All,

      I have strange issue with our ESB application. The situation is as below.

      I have Queue named "JMSIntermidiateQ" and corresponding busid "JMSIntermidiateQbusid" configured on two different ESB running on two different machines. The same queue name and busid is defined for this two ESB's.

      ESB 1 running on a machine with ip x.x.x.12

      First ESB will take the input message through providers and ESB process the message and finally it will send the message to an ESB running on another machine (x.x.x.13) using JMS Router as follows. Please note that the same queue name and busid is available locally also(in x.x.x.12 also).

      <action name="JMSRouter"
       class="org.jboss.soa.esb.actions.routing.JMSRouter">
       <property name="jndi-context-factory"
       value="org.jnp.interfaces.NamingContextFactory" />
       <property name="jndi-URL" value="x.x.x.13:1099" />
       <property name="jndi-pkg-prefix"
       value="org.jboss.naming:org.jnp.interfaces" />
       <property name="connection-factory"
       value="ConnectionFactory" />
       <property name="jndiName"
       value="queue/JMSIntermidiateQ" />
       <property name="unwrap" value="true"/>
       </action>
      


      ESB 2 running on another machine with ip x.x.x.13

      The ESB running in this machine listens for this Queue(JMSIntermidiateQ).
      This queue is configured in this ESB also.

      <jms-listener name="JMSIntermidiateQListener"
       busidref="JMSIntermidiateQbusid" maxThreads="50" is-gateway="true" />
      

      But what happens is that instead sending the message to queue which is listening on machine x.x.x.13, it is routing the message to the local queue(Queue on x.x.x.12). Sometimes only the message is getting routed to the queue running in x.x.x.13.

      Please help us in resolving this. This is making a big issue for us.

      Thanks & Regards,
      Arjun

        • 1. Re: Problem with Message routing in ESB
          arjun purushothaman Newbie

          Hi All,

          Please someone help us in this issue as it is making a big road block to our application.

          Regards,
          Arjun

          • 2. Re: Problem with Message routing in ESB
            Tom Fennelly Master

            Hmmm... obviously sounds as though the JMS Router is not using the jndi config (provider url) defined on the config.

            As a test... what happens if you undeploy the local JMS Queue? What error do you get?

            • 3. Re: Problem with Message routing in ESB
              Martin Vecera Novice

              Hello,

              we run similar configuration without problems. Here is a list of some blind shots you can try:

              * make sure that your servers are bound to the correct IP's - i.e. run.sh -b x.x.x.12
              * try to run the servers in a different UDP group - i.e. run.sh -u 230.1.1.1 -g grp1 and run.sh -u 230.1.1.2 -g grp2
              * do your servers share the same database? - try the opposite configuration
              * make sure that the queue is not deployed as clustered
              * try changing the value of the unwrap property

              • 4. Re: Problem with Message routing in ESB
                arjun purushothaman Newbie

                Hi Tom,

                We tried to send 10 messages to the ESB running on x.x.x.13 from x.x.x.12, only 7 will reach the ESB on x.x.x.13 and remaining 3 messages will get routed to local Queue Itself.
                We even tried commenting the local Queue Listener also in the jboss-esb.xml(running in x.x.x.12). But still it gets routed to the local Queue.

                Hi Martin,

                We are bounding the correct IP only to these two servers
                i.e, run.bat -b x.x.x.12 & run.bat -b x.x.x.13
                Also servers are not sharing the same database.

                How to check whether the queue is depolyed as clustered ?
                (Iam assuming that xxx-persistence-service.xml having the clustered Attribute should be set to false as below.

                <attribute name="Clustered">false</attribute>
                ). No other place we have configured clustering explicitly. Is there any other place we need to set it as false ?


                We will try running the servers in different UDP groups also as you adviced.

                Thanks & Regards,
                Arjun

                • 5. Re: Problem with Message routing in ESB
                  Martin Vecera Novice

                  Ok, services should not be clustered by default. Show me your jboss-esb.xml from both servers.

                  If you renamed one of the queues, would it work as expected? Wouldn't it be the easiest solution?

                  • 6. Re: Problem with Message routing in ESB
                    arjun purushothaman Newbie

                    Hi Martin,

                    Please find the jboss-esb.xml file. Iam posting only the relevant portion of the jboss-esb.xml since the file content is pretty big.

                    Both the jboss-esb.xml file at x.x.x.12 & x.x.x.13 are same except that JMS Router IP for the Queue(JMSIntermidiateQ) is different.

                    At x.x.x.12

                    <providers>
                    
                    
                     <!-- JMS Intermidiate Gateway Queue -->
                     <jms-bus busid="JMSIntermidiateQbusid">
                     <jms-message-filter dest-type="QUEUE"
                     dest-name="queue/JMSIntermidiateQ" />
                     </jms-bus>
                    </providers>
                    
                    <services>
                    
                     <!-- Other services are there -->
                    
                    <service category="TransportService" name="TransportService"
                     description="Transport Service">
                    
                     <listeners>
                    
                    
                     <jms-listener name="TransportChannel"
                     busidref="TransportQbusid" />
                    
                     </listeners>
                    
                     <actions mep="OneWay">
                    
                     <action name="action2"
                     class="org.jboss.soa.esb.actions.SystemPrintln">
                     <property name="message"
                     value="######Exposing the data to outside world########" />
                     </action>
                    
                     <action name="TransportAction"
                     class="com.cc.esb.transport.TransportAction"
                     process="processMessage">
                     <property name="exceptionMethod"
                     value="transportActionExceptionHandler" />
                     </action>
                    <action name="JMSRouter"
                     class="org.jboss.soa.esb.actions.routing.JMSRouter">
                     <property name="jndi-context-factory"
                     value="org.jnp.interfaces.NamingContextFactory" />
                     <property name="jndi-URL" value="x.x.x.13:1099" />
                     <property name="jndi-pkg-prefix"
                     value="org.jboss.naming:org.jnp.interfaces" />
                     <property name="connection-factory"
                     value="ConnectionFactory" />
                     <property name="jndiName"
                     value="queue/JMSIntermidiateQ" />
                     <property name="unwrap" value="true"/>
                     </action>
                     </actions>
                    
                     </service>
                    
                    <!-- Main JMS Inbound Service -->
                     <service category="JMSInBoundExtMainService"
                     name="SimpleListener" description="Main JMS Ext Service">
                    
                     <listeners>
                    
                     <jms-listener name="JMSIntermidiateQListener"
                     busidref="JMSIntermidiateQbusid" maxThreads="50" is-gateway="true" />
                     <jms-listener name="ESBIntermidiateDummyQListener"
                     busidref="ESBIntermidiateDummyQbusid" />
                    
                     </listeners>
                    
                     <actions mep="OneWay">
                    
                    <action name="action1" class="org.jboss.soa.esb.actions.SystemPrintln">
                     <property name="message" value="######Inside main Service########" />
                     </action>
                    
                     </actions>
                    
                     </service>
                    
                    </services>
                    



                    At x.x.x.13

                    <providers>
                    
                    
                     <!-- JMS Intermidiate Gateway Queue -->
                     <jms-bus busid="JMSIntermidiateQbusid">
                     <jms-message-filter dest-type="QUEUE"
                     dest-name="queue/JMSIntermidiateQ" />
                     </jms-bus>
                    </providers>
                    
                    <services>
                    
                     <!-- Other services are there -->
                    
                    <service category="TransportService" name="TransportService"
                     description="Transport Service">
                    
                     <listeners>
                    
                    
                     <jms-listener name="TransportChannel"
                     busidref="TransportQbusid" />
                    
                     </listeners>
                    
                     <actions mep="OneWay">
                    
                     <action name="action2"
                     class="org.jboss.soa.esb.actions.SystemPrintln">
                     <property name="message"
                     value="######Exposing the data to outside world########" />
                     </action>
                    
                     <action name="TransportAction"
                     class="com.cc.esb.transport.TransportAction"
                     process="processMessage">
                     <property name="exceptionMethod"
                     value="transportActionExceptionHandler" />
                     </action>
                    <action name="JMSRouter"
                     class="org.jboss.soa.esb.actions.routing.JMSRouter">
                     <property name="jndi-context-factory"
                     value="org.jnp.interfaces.NamingContextFactory" />
                     <property name="jndi-URL" value="127.0.0.1:1099" />
                     <property name="jndi-pkg-prefix"
                     value="org.jboss.naming:org.jnp.interfaces" />
                     <property name="connection-factory"
                     value="ConnectionFactory" />
                     <property name="jndiName"
                     value="queue/JMSIntermidiateQ" />
                     <property name="unwrap" value="true"/>
                     </action>
                     </actions>
                    
                     </service>
                    
                    <!-- Main JMS Inbound Service -->
                     <service category="JMSInBoundExtMainService"
                     name="SimpleListener" description="Main JMS Ext Service">
                    
                     <listeners>
                    
                     <jms-listener name="JMSIntermidiateQListener"
                     busidref="JMSIntermidiateQbusid" maxThreads="50" is-gateway="true" />
                     <jms-listener name="ESBIntermidiateDummyQListener"
                     busidref="ESBIntermidiateDummyQbusid" />
                    
                     </listeners>
                    
                     <actions mep="OneWay">
                    <action name="action1" class="org.jboss.soa.esb.actions.SystemPrintln">
                     <property name="message" value="######Inside main Service########" />
                     </action>
                    
                     </actions>
                    
                     </service>
                    
                    </services>
                    



                    What we tried is commenting the listener of the Queue (JMSIntermidiateQ) in x.x.x.12 so that the message from x.x.x.12 will always goes to x.x.x.13. But sometimes it is getting routed to the local Queue(x.x.x.12).

                    We cannot rename the Queue as our requirement was like that. We have developed one ESB as a product so that same can be deployed in different servers. Only the JMS router ip address needs to be changed.

                    Please let me know if you need more to details.

                    Thanks in Advance,
                    Regards,
                    Arjun

                    • 7. Re: Problem with Message routing in ESB
                      Martin Vecera Novice

                      First, fix this line:

                      <property name="jndi-URL" value="127.0.0.1:1099" />

                      You do not have any server bound to localhost, do you?

                      Second, show me your jms-provider or jms-jca-provider definition as well (should be between and <jms-bus>.

                      • 8. Re: Problem with Message routing in ESB
                        arjun purushothaman Newbie

                        Hi Martin,

                        Yes we have server bound to localhost. We are running the server like
                        "run.bat -b 0.0.0.0" (so that the server will get bound to localhost as well as 127.0.0.1 )

                        Please find the jms-provider details below.

                        <jms-provider name="JBossMessaging"
                         connection-factory="ConnectionFactory">
                        
                         <!-- JMSProvider Gateway Queue -->
                         <jms-bus busid="JMSProviderQbusid">
                         <jms-message-filter dest-type="QUEUE"
                         dest-name="queue/JMSProviderQ" />
                         </jms-bus>
                        </jms-provider>


                        Regards,
                        Arjun

                        • 9. Re: Problem with Message routing in ESB
                          Martin Vecera Novice

                          Previously you told that:

                          We are bounding the correct IP only to these two servers
                          i.e, run.bat -b x.x.x.12 & run.bat -b x.x.x.13


                          I suggest you to try this and specify to valid IP address in jboss-esb.xml.


                          • 10. Re: Problem with Message routing in ESB
                            arjun purushothaman Newbie

                            Hi Martin,

                            We used to try both. i.e, bounding to 0.0.0.0 and also sometimes bounding to
                            the specific IP.

                            We thought that bounding the server to 0.0.0.0 is good coz we can avoid the hard coding of the IP (incase the IP of hosting server changes, it won't create any problem). But since the issue seems to be because of bounding like this, we will now on try with specific IP.

                            Thanks & Regards,
                            Arjun

                            • 11. Re: Problem with Message routing in ESB
                              Martin Vecera Novice

                              Hello, how are you with the issue? According to the silence it seems to me like we are done, aren't we?

                              • 12. Re: Problem with Message routing in ESB
                                Anonymous User Newbie

                                Hello all,

                                we had a similar problem. Messages from server B (test) with (IP x.x.x.x) were routed to server A (productive) (with IP y.y.y.y). After some time we found out that old settings, messages, queues, services etc. on jbossesb meta-database were stored, cause we have dumped database for server A to database for server B some days ago before troubles occurred.

                                Unfortunately JBossESB on server B could not re - organize probably with new settings configured in property files after restarting the server. So some services were invoked on server A with message from server B.

                                The solution was to empty jbossesb meta-database with wrong settings (e.g. by deleting jbossesb user and re-create it on database X).

                                Best regards,

                                Dennis

                                • 13. Re: Problem with Message routing in ESB
                                  Anonymous User Newbie

                                  Hello all,

                                  we had a similar problem. Messages from server B (test) with (IP x.x.x.x) were routed to server A (productive) (with IP y.y.y.y). After some time we found out that old settings, messages, queues, services etc. on jbossesb meta-database were stored, cause we have dumped database for server A to database for server B some days ago before troubles occurred.

                                  Unfortunately JBossESB on server B could not re - organize probably with new settings configured in property files after restarting the server. So some services were invoked on server A with message from server B.

                                  The solution was to empty jbossesb meta-database with wrong settings (e.g. by deleting jbossesb user and re-create it on database X).

                                  Best regards,

                                  Dennis

                                  • 14. Re: Problem with Message routing in ESB
                                    arjun purushothaman Newbie

                                    Hi Martin,

                                    It seems like the issue is fixed with that bounding of IP instead of 0.0.0.0.
                                    We didn't faced that issue after that.
                                    Thanks for your help -:)

                                    Hi Dennis,

                                    Our underlying jbossesb db was HSQL only. So every time when we restart the server, the previous data won't be there. So i don't think it was because of the issue with jbossesb meta database.

                                    Regards,
                                    Arjun