3 Replies Latest reply on Aug 8, 2007 2:29 PM by timfox

    onMessage not being fired for message on a queue

    hibsmax

      Hi, Group.

      This question is vague and I apologise for that up front. I'm mainly looking for pointers to help me determine where to start looking.

      I have an application that:
      1. produces a message
      2. writes the message to a database
      3. pushes the message to queue
      4. update the record in the database
      5. sends the message to a topic
      6. a consumer then consumes the messages on the topic

      steps 1-3 happen in a servlet running on server1
      steps 4-5 happen in the onMessage method in an MDB running on server2

      All the messages make it to the database so I know that steps 1, 2 and 3 are all working. I have a debug statement in the onMessage method and I can see that it's not being called for every message e.g. I send 450 messages but the onMessage is only executed 210 times. When I look in the JBM_MSG table I see what I believe are the missing messages (I check the headers column using the SQL below).

      Can anyone suggest a reason why the onMessage method would not be called for every message? I know it's being called sometimes, just not all the time. I think I must be missing a config parameter or something.

      I am using JBM 1.3 GA and Oracle.

      Peace, Anders

      SQL to check jbm_msg.headers:
      SELECT UTL_RAW.CAST_TO_VARCHAR2 (DBMS_LOB.SUBSTR (headers))
      FROM jbm_msg
      /

        • 1. Re: onMessage not being fired for message on a queue
          hibsmax

          When I move everything to a single server environment i.e. deploy everything to one server, I get 100% success. There seems to be an issue when I split the application over multiple machines.

          Thanks, Anders

          • 2. Re: onMessage not being fired for message on a queue
            hibsmax

            I have made more progress / discoveries and I think I now know how to ask the question better.

            Consider the following configuration:
            server1 - servlet and destinations
            server2 - MDB and destinations

            the destinations are configured with clustered=true.

            When I run my tests, about half the messages end up on each server. However, the MDB only processes the messages that appear on the destinations on server2 i.e. the same server as its deployed on. How do I get my MDB to process messages on a clustered destination when the message is on a different server? Do I need to have the MDB deployed on both servers as well?

            Peace, Anders

            • 3. Re: onMessage not being fired for message on a queue
              timfox

              Message redistribtuion has been imporoved in JBM 1.4.0 and works somewhat differently to 1.3.0.

              I suggest you try out 1.4.0.CR2 or 1.4.0.GA when they are released shortly