5 Replies Latest reply on Aug 1, 2009 3:32 AM by timfox

    Bridge with QOS_ONCE_AND_ONLY_ONCE

    stuartw

      I am trying to configure a bridge with the quality of service set to QOS_ONCE_AND_ONLY_ONCE in JBoss Messaging 1.4.4 within JBoss AS 4.2.3. As far as I understand, for this to work I must use an XA datasource. I have therefore changed the DefaultDS to an XA one. However, this gives me problems when I try to start the server where it is attempting to create the tables:

      [main] 09:32:43,404 TRACE [org.jboss.messaging.core.impl.JDBCSupport] Executing: CREATE TABLE JBM_USER (USER_ID VARCHAR2(32) NOT NULL, PASSWD VARCHAR2(32) NOT NULL, CLIENTID VARCHAR2(128), PRIMARY KEY(USER_ID))
      [main] 09:32:43,404 DEBUG [org.jboss.messaging.core.impl.JDBCSupport] Failed to execute: CREATE TABLE JBM_USER (USER_ID VARCHAR2(32) NOT NULL, PASSWD VARCHAR2(32) NOT NULL, CLIENTID VARCHAR2(128), PRIMARY KEY(USER_ID))
      java.sql.SQLException: ORA-02089: COMMIT is not allowed in a subordinate session
      


      If I change the datasource to a non-XA one then the tables are created successcully but my bridge does not work. Can anyone help me please?

        • 1. Re: Bridge with QOS_ONCE_AND_ONLY_ONCE
          gaohoward

          QOS_ONCE_AND_ONLY_ONCE is used by the bridge to internally control the way it move the messages from the source to target. It's nothing to do with datasource. So you don't need to change the Datasource.

          • 2. Re: Bridge with QOS_ONCE_AND_ONLY_ONCE
            stuartw

            Thanks very much for a quick response. In that case I think I must have misunderstood what I required to do based on the following quote from the documentation:

            If JTA is required then both supplied connection factories need to be XAConnectionFactory implementations


            It turns out that I was already doing this anyway. I tried changing so many things that I didn't fully understand which change had actually made everything work. Having stripped everything right back it turns out that the issue I was seeing was related to the fact that I did not have a unique ServerPeerID on each of my JBoss instances.

            I do have a question about the ServerPeerID value though. In the supplied file the value is set as follows:
            <attribute name="ServerPeerID">${jboss.messaging.ServerPeerID:0}</attribute>
            


            I changed this to:
            <attribute name="ServerPeerID">5</attribute>
            

            and also to:
            <attribute name="ServerPeerID">${jboss.messaging.ServerPeerID:5}</attribute>
            

            Both of which seem to work for me, which is the correct (or preferred) way to set this? Also, what is the difference between the two?

            • 3. Re: Bridge with QOS_ONCE_AND_ONLY_ONCE
              gaohoward

              ${jboss.messaging.ServerPeerID:5} means you can set the server peer ID by defining the jboss.messaging.ServerPeerID property in startup command line (run.sh), but if you don't define it, the server peer id defaults to 5.

              • 4. Re: Bridge with QOS_ONCE_AND_ONLY_ONCE
                stuartw

                Thanks very much, I assume that I could also set jboss.messaging.ServerPeerID using the properties-service.xml

                • 5. Re: Bridge with QOS_ONCE_AND_ONLY_ONCE
                  timfox

                  JBM 1.4 should *never* be used with an XA JDBC data source.