Uploaded image for project: 'Sandesha2'
  1. Sandesha2
  2. SANDESHA2-179

Adding correct message numbers with jdbc storage

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      I ran a 100 message message sequence using the jdbc storage. The message receiver looks like this,

      protected void invokeBusinessLogic(MessageContext messageContext)
      throws AxisFault

      { System.out.println("Got the soap message ==> " + messageContext.getEnvelope().getBody().getFirstElement()); }

      and the client has this code to produce 100 messages.

      for (int i = 1; i < 100; i++) {
      serviceClient.fireAndForget(getTestOMElement);
      try

      { Thread.sleep(1000); }

      catch (InterruptedException e) {
      }
      }

      private OMElement getTestOMElement(long number)

      { OMFactory omFactory = OMAbstractFactory.getOMFactory(); OMNamespace omNamespace = omFactory.createOMNamespace("http://wso2.org/temp1", "ns1"); OMElement omElement = omFactory.createOMElement("TestElement", omNamespace); omElement.setText("org element " + number); return omElement; }

      so I expects a 1 - 100 message sequence as follows on the server side console.

      Got the soap message ==> <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 1</ns1:TestElement>
      Got the soap message ==> <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 2</ns1:TestElement>
      Got the soap message ==> <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 3</ns1:TestElement>

      but there were some missing messages in this sequence

      Got the soap message ==> <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 14</ns1:TestElement>
      Got the soap message ==> <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 15</ns1:TestElement>
      Got the soap message ==> <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 17</ns1:TestElement>

      However message sequence terminates properly. but server sends acknowledgments only for 96 messsages.

      Then I went through each and every message using tcp mon and saw the following.

      <wsrm:Sequence xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" soapenv:mustUnderstand="1">
      <wsrm:Identifier>urn:uuid:63C7D88DAE5A969F4C1224742882720</wsrm:Identifier>
      <wsrm:MessageNumber>15</wsrm:MessageNumber>
      </wsrm:Sequence>
      </soapenv:Header>
      <soapenv:Body>
      <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 15</ns1:TestElement>
      </soapenv:Body>

      <wsrm:Sequence xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" soapenv:mustUnderstand="1">
      <wsrm:Identifier>urn:uuid:63C7D88DAE5A969F4C1224742882720</wsrm:Identifier>
      <wsrm:MessageNumber>15</wsrm:MessageNumber>
      </wsrm:Sequence>
      </soapenv:Header>
      <soapenv:Body>
      <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 16</ns1:TestElement>
      </soapenv:Body>

      So the reason is that the message number 15 is repeated in two messages. But this did not happen with the Inmemory mode. Seems to be a transaction handling problem. I am testing with the Derby data base.

      Attachments

        1. core_patch.txt
          6 kB
          Amila Chinthaka Suriarachchi
        2. patch.txt
          57 kB
          Damitha N.M. Kumarage
        3. patch.txt
          2 kB
          Amila Chinthaka Suriarachchi
        4. persistence_patch.txt
          14 kB
          Amila Chinthaka Suriarachchi

        Activity

          People

            Unassigned Unassigned
            amilachinthaka Amila Chinthaka Suriarachchi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: