4 Replies Latest reply on May 26, 2006 6:16 PM by njipwo Bertrand

    Can't persist transmitted messages in JMS_MESSAGES

    njipwo Bertrand Newbie

      Hi community,

      I'm analysing the following fact:

      One or more client send a message to a process instance running on the AS. The server receives different SOAP-messages from different clients and send the right Response the each client.

      I'm interresting to analyse this fact. For that purpose i have installed :
      JBossAS-4.0.3SP1,
      JBPM-3.0.2,
      MySQL Server and ... ....

      I have configured the system and every thing works without problem. Futhermore i have configure the JMS Messaging (MQ-Messaging) on JBoss to persist messages that are send by clients. This seems to work without problem.

      I have the following problem:

      I'm expecting the sever to log the Qeues activities in the JMS_MESSAGES table. But when i look in the the defined JMS DataBase table there is no entry (MESSAGEID, DESTINATION, ..., MESSAGEBLOB).

      Can some one tell me if i'm missing some think on how the JMS Service works in BPEL-Processes or no entries in the JMS_MESSAGES is related to my configuration.

      For those who has allready successfull persist transmitted message in the JMS_MESSAGES table as BLOB what do i need to configure in oder to store messages in my DB.


      Thanks for your help.

      Best Regards


      Bertrand Njipwo

        • 1. Re: Can't persist transmitted messages in JMS_MESSAGES
          Alejandro Guizar Master

          It's hard to tell without more information. If your server log does not show any JDBC connectivity errors, consider that messages are deleted once they are delivered.

          What are you trying to do with the queue activity logs?

          • 2. Re: Can't persist transmitted messages in JMS_MESSAGES
            njipwo Bertrand Newbie

            Hello alex,

            thanks for the fast answer.

            I'm working on my master these and we have a module which performs some parameter (Throuput, delay, aviability .....and , and, and) according to the bussiness process it receives the call. Whe need a way to bind all collected perfomance information to each mother process.

            Using decomposition we can see a bussiness process (BPEL-process) as composition of several web services and for each of this web service perfomance informations are perform after a request (HTTPSOAP) is send and i need a way bind those information to the bussiness process.

            The problem is that the performance module didn't know about the bussiness process. It's just receive Web service request performes some computation and send the response back to the caller. The idea was here to identify the process instance via a processID and all messages who are sent to this proccess (processID) will be persist. Later we just only need to query our database to find out wich messageID was sent to wich processID.

            For that purporse i'm trying to find out how messages sended by clients are identify on the server side in oder to route the right answer to the differents clients.



            I have all ready find out that in case of BPEL processes that Inbound qeueus are used and are attached to each partnerlink in the process definition so that the partnerlink (client) are notified when a message is senr to the inbound qeueu attached to him.

            For those reasons its important for me to see which informations are persist when messages are send.



            I hope i 'm right in my choice to use the JBPM-BPEL extension in order to persist process informations.

            What you think this new idea: may be the performace module should use (implement) the JMS service in order to identify the bussiness prossesses.



            I hop you can understand the back ground of my investigation.

            My last question will be what do i need to set up in my configuration in oder to persist the transmitted messages for a long time in the database?

            Thanks again for any suggestion.


            Regards

            Bertrand

            • 3. Re: Can't persist transmitted messages in JMS_MESSAGES
              njipwo Bertrand Newbie

              Hello once again,

              i just wan to bring additional information about my configuration and settings.

              I have no error when sending some messages to the client. Every think works well. No JDBC connectivity errors. The connection with the DataBase via the datasource is successfull (Following tables are created: ms_messages, jms_roles, jms_subcriptions, jms_transactions, jms_users, timer )

              The only think i'm expecting is some entries in the JMS_MESSAGES table.

              Hier is my mysql-ds.xml file:

              <?xml version="1.0" encoding="UTF-8"?>
              <!-- $Id: mysql-ds.xml,v 1.3.2.1 2004/12/01 11:46:00 schrouf Exp $ -->
              <!-- Datasource config for MySQL using 3.0.9 available from:
              http://www.mysql.com/downloads/api-jdbc-stable.html
              -->
              <datasources>
               <local-tx-datasource>
               <jndi-name>MySqlDS</jndi-name>
               <connection-url>jdbc:mysql://localhost/jbpmjmsdb</connection-url>
               <driver-class>com.mysql.jdbc.Driver</driver-class>
               <user-name>jbpmuser</user-name>
               <password>jbpmuser</password>
               <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
               <!-- sql to call when connection is created
               <new-connection-sql>some arbitrary sql</new-connection-sql>
               -->
               <!-- sql to call on an existing pooled connection when it is obtained from pool
               <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
               -->
               <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
               <metadata>
               <type-mapping>mySQL</type-mapping>
               </metadata>
               </local-tx-datasource>
              </datasources>
              
              



              and the mysql-jdbc2-service file :

              <?xml version="1.0" encoding="UTF-8"?>
              
              <!-- $Id: mysql-jdbc2-service.xml,v 1.8.2.4 2005/08/13 20:47:52 adrian Exp $ -->
              
              <server>
              
               <!-- ==================================================================== -->
               <!-- Persistence and caching using MySQL -->
               <!-- IMPORTANT: Remove hsqldb-jdbc2-service.xml -->
               <!-- ==================================================================== -->
              
               <!--
               | The destination manager is the core service within JBossMQ
               -->
               <mbean code="org.jboss.mq.server.jmx.DestinationManager" name="jboss.mq:service=DestinationManager">
               <depends optional-attribute-name="MessageCache">jboss.mq:service=MessageCache</depends>
               <depends optional-attribute-name="PersistenceManager">jboss.mq:service=PersistenceManager</depends>
               <depends optional-attribute-name="StateManager">jboss.mq:service=StateManager</depends>
               </mbean>
              
               <!--
               | The MessageCache decides where to put JBossMQ message that
               | are sitting around waiting to be consumed by a client.
               |
               | The memory marks are in Megabytes. Once the JVM memory usage hits
               | the high memory mark, the old messages in the cache will start getting
               | stored in the DataDirectory. As memory usage gets closer to the
               | Max memory mark, the amount of message kept in the memory cache aproaches 0.
               -->
               <mbean code="org.jboss.mq.server.MessageCache"
               name="jboss.mq:service=MessageCache">
               <attribute name="HighMemoryMark">50</attribute>
               <attribute name="MaxMemoryMark">60</attribute>
               <attribute name="CacheStore">jboss.mq:service=PersistenceManager</attribute>
               </mbean>
              
               <!-- The PersistenceManager is used to store messages to disk. -->
               <!--
               | The jdbc2 PersistenceManager is the new improved JDBC implementation.
               | This implementation allows you to control how messages are stored in
               | the database.
               |
               | This jdbc2 PM configuration has was supplied by Stephane Nicoll in the forums as an example for MySQL
               -->
               <mbean code="org.jboss.mq.pm.jdbc2.PersistenceManager"
               name="jboss.mq:service=PersistenceManager">
               <!--depends optional-attribute-name="ConnectionManager">jboss.jca:service=DataSourceBinding,name=DefaultDS</depends-->
               <depends optional-attribute-name="ConnectionManager">jboss.jca:service=DataSourceBinding,name=MySqlDS</depends>
              
              <!-- Changed: SELECT_MAX_TX = SELECT MAX(TXID) FROM (SELECT MAX(TXID) AS TXID FROM JMS_TRANSACTIONS UNION SELECT MAX(TXID) AS TXID FROM JMS_MESSAGES) AS TR_TABLE-->
               <attribute name="SqlProperties">
               BLOB_TYPE=BYTES_BLOB
               INSERT_TX = INSERT INTO JMS_TRANSACTIONS (TXID) values(?)
               INSERT_MESSAGE = INSERT INTO JMS_MESSAGES (MESSAGEID, DESTINATION, MESSAGEBLOB, TXID, TXOP) VALUES(?,?,?,?,?)
               SELECT_ALL_UNCOMMITED_TXS = SELECT TXID FROM JMS_TRANSACTIONS
               SELECT_MAX_TX = SELECT MAX(TXID) FROM (SELECT MAX(TXID) AS TXID FROM JMS_TRANSACTIONS UNION SELECT MAX(TXID) AS TXID FROM JMS_MESSAGES) AS TR_TABLE
               DELETE_ALL_TX = DELETE FROM JMS_TRANSACTIONS
               SELECT_MESSAGES_IN_DEST = SELECT MESSAGEID, MESSAGEBLOB FROM JMS_MESSAGES WHERE DESTINATION=?
               SELECT_MESSAGE = SELECT MESSAGEID, MESSAGEBLOB FROM JMS_MESSAGES WHERE MESSAGEID=? AND DESTINATION=?
               MARK_MESSAGE = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE MESSAGEID=? AND DESTINATION=?
               UPDATE_MESSAGE = UPDATE JMS_MESSAGES SET MESSAGEBLOB=? WHERE MESSAGEID=? AND DESTINATION=?
               UPDATE_MARKED_MESSAGES = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE TXOP=?
               UPDATE_MARKED_MESSAGES_WITH_TX = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE TXOP=? AND TXID=?
               UPDATE_MESSAGE = UPDATE JMS_MESSAGES SET MESSAGEBLOB=? WHERE MESSAGEID=? AND DESTINATION=?
               UPDATE_MARKED_MESSAGES = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE TXOP=?
               UPDATE_MARKED_MESSAGES_WITH_TX = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE TXOP=? AND TXID=?
               DELETE_MARKED_MESSAGES_WITH_TX = DELETE JMS_MESSAGES FROM JMS_MESSAGES, JMS_TRANSACTIONS WHERE JMS_MESSAGES.TXID = JMS_TRANSACTIONS.TXID AND JMS_MESSAGES.TXOP=?
               DELETE_TX = DELETE FROM JMS_TRANSACTIONS WHERE TXID = ?
               DELETE_MARKED_MESSAGES = DELETE FROM JMS_MESSAGES WHERE TXID=? AND TXOP=?
               DELETE_TEMPORARY_MESSAGES = DELETE FROM JMS_MESSAGES WHERE TXOP='T'
               DELETE_MESSAGE = DELETE FROM JMS_MESSAGES WHERE MESSAGEID=? AND DESTINATION=?
               CREATE_MESSAGE_TABLE = CREATE TABLE JMS_MESSAGES (MESSAGEID INTEGER NOT NULL, DESTINATION VARCHAR(150) NOT NULL, TXID INTEGER, TXOP CHAR(1), MESSAGEBLOB LONGBLOB, PRIMARY KEY (MESSAGEID, DESTINATION))
               CREATE_IDX_MESSAGE_TXOP_TXID = CREATE INDEX JMS_MESSAGES_TXOP_TXID ON JMS_MESSAGES (TXOP, TXID)
               CREATE_IDX_MESSAGE_DESTINATION = CREATE INDEX JMS_MESSAGES_DESTINATION ON JMS_MESSAGES (DESTINATION)
               CREATE_TX_TABLE = CREATE TABLE JMS_TRANSACTIONS ( TXID INTEGER, PRIMARY KEY (TXID) )
               CREATE_TABLES_ON_STARTUP = TRUE
               </attribute>
               <!-- Uncomment to override the transaction timeout for recovery per queue/subscription, in seconds -->
               <!--attribute name="RecoveryTimeout">0</attribute-->
               </mbean>
              </server>
              
              .

              Is there some one who already configure this successfully and can tell me what is wrong in my configuration ?
              Please let me know If you need additional information like server log-file.

              Thank once again


              Bertrand N.

              • 4. Re: Can't persist transmitted messages in JMS_MESSAGES
                njipwo Bertrand Newbie

                Hello community,

                i have persisted somes messages in the jms_messages database.
                What i'm finding strange is that the messages are persisted in the DB only when i stop and restart the testQueue in the JMX Console. Only if i do this Messages are persisted and clients receive some answer back (java.net.SocketTimeoutException: Read timed out .... ) only after a timeout.

                This means Alex's assumptions where wright: If every think works well nothink will happen. Message will be persist only in case of failure (Queue not reachable).

                In the jmx console browsing the testQueu the method listMessages() gives following informations back:

                [org.jboss.mq.SpyObjectMessage {
                Header {
                 jmsDestination : QUEUE.testQueue
                 jmsDeliveryMode : 2
                 jmsExpiration : 0
                 jmsPriority : 4
                 jmsMessageID : ID:3-11486715531501
                 jmsTimeStamp : 1148671553150
                 jmsCorrelationID: null
                 jmsReplyTo : QUEUE.JMS_TQ3
                 jmsType : null
                 jmsRedelivered : false
                 jmsProperties : {_$partnerLinkId=3, _$operationName=sayHello}
                 jmsPropReadWrite: false
                 msgReadOnly : true
                 producerClientId: ID:3
                }
                }, org.jboss.mq.SpyObjectMessage {
                Header {
                 jmsDestination : QUEUE.testQueue
                 jmsDeliveryMode : 2
                 jmsExpiration : 0
                 jmsPriority : 4
                 jmsMessageID : ID:3-11486716083902
                 jmsTimeStamp : 1148671608390
                 jmsCorrelationID: null
                 jmsReplyTo : QUEUE.JMS_TQ4
                 jmsType : null
                 jmsRedelivered : false
                 jmsProperties : {_$partnerLinkId=3, _$operationName=sayHello}
                 jmsPropReadWrite: false
                 msgReadOnly : true
                 producerClientId: ID:3
                }
                }, org.jboss.mq.SpyObjectMessage {
                Header {
                 jmsDestination : QUEUE.testQueue
                 jmsDeliveryMode : 2
                 jmsExpiration : 0
                 jmsPriority : 4
                 jmsMessageID : ID:3-11486716315733
                 jmsTimeStamp : 1148671631573
                 jmsCorrelationID: null
                 jmsReplyTo : QUEUE.JMS_TQ5
                 jmsType : null
                 jmsRedelivered : false
                 jmsProperties : {_$partnerLinkId=3, _$operationName=sayHello}
                 jmsPropReadWrite: false
                 msgReadOnly : true
                 producerClientId: ID:3
                }
                }]
                


                The table jms_messages:
                (MESSAGEID, DESTINATION, TXID, TXOP, MESSAGEBLOB) has values: (0, QUEUE.testQueue, Null, A, BLOB),
                (1, QUEUE.testQueue, Null, A, BLOB),
                (2, QUEUE.testQueue, Null, A, BLOB).

                In the JBPM BPEL 1.0_UserGuide it's says :

                The BPEL extension uses JMS to ensure orderly delivery of incoming messages to the right
                process instances. Each partner link in a process definition is assigned a queue. An inbound
                message activity (receive, pick or onMessage event) listens for messages on the queue
                assigned to its partner link. When a SOAP message arrives at the port component that
                represents that partner link, it is sent to the same queue. The selection feature of JMS routes it
                to the right receiver.


                If i understand this well all process partners (clients) listen on the same queue testQueue that's why we have for each persisted message the same destination QUEUE.testQueue. But it seams to be that the server (May be process instance) identifies the clients with the internalID jmsReplyTo : QUEUE.JMS_TQ3, jmsReplyTo: QUEUE.JMS_TQ4, jmsReplyTo: QUEUE.JMS_TQ5 .

                My question hier is to know the function of the jmsReplyTo field. Is it generated form the server to distinguish clients? All this informations are not clear for me (How different clients are bound to the same queue and how the process instance can identify the wright client ).

                I need your help to understand how the communication works according to process instances. Any suggestion, document reference or any link will help.


                Thanks in advance

                Bertrand Njipwo