2 Replies Latest reply on Apr 25, 2002 1:14 AM by tone

    Sending several JMS messages seems to destroy internal varia

    tone

      Example of code in onMessage() in my MDB:

      TextMessage msg = ( TextMessage ) message;
      int nAction;
      int nMessageType;

      // Get the message type:
      nMessageType = new Integer(msg.getStringProperty("MessageType")).intValue();


      // Get the action code:
      nAction = new Integer( msg.getStringProperty("Action") ).intValue();


      ..
      .. a good deal of code here....
      ..

      if ( nMessageType = JMSConstants.PURCHASEORDER )
      {
      // Here I want to read more from the message:
      strTmp = msg.getStringProperty("PkId");
      nPkId = new Integer( strTmp).intValue);
      }
      else
      nPkId = 0;


      What seems to happen from time to time is that I don't get any value into the
      variable nPkId - because it seems that 'someone' has changed the nMessageType
      variable.
      The only explanation I have is that two JMS messages are consumed by the same MDB,
      and it seems to me that the second JMS overwrites the internal variables nAction
      and nMessageType, but it doesn't exactly seem logical to me,

      What on earth is going on?

      I do hope someone can help me!!

      Tone