2 Replies Latest reply on Jun 30, 2006 2:28 AM by Nooreazam Peerzade

    Recieving message from a queue

    Nooreazam Peerzade Newbie

      Hi,

      Iam using the following snippet both in JBoss and the WebLogic server.

      timeOutInSeconds=60;
      Message message = qReceiver.receive(timeOutInSeconds*1000);
      if( message == null )
      {
      //throw exception; user defined
      }else{
      if( message instanceof TextMessage )
      {
      result = ((TextMessage) message).getText();
      } else {
      //throw exception; user defined
      }
      }


      Problem is,
      In Weblogic, the message is null and it is still able to process further.
      In JBoss also the message is null, but not able to process further.
      It is throwing the exception.

      Following are the message formats--
      In weblogic--
      Message = >TextMessage[null, ]

      In JBoss--
      Message = >SpyTextMessage {
      Header {
      jmsDestination : null
      jmsDeliveryMode : -1
      jmsExpiration : 0
      jmsPriority : -1
      jmsMessageID : null
      jmsTimeStamp : 0
      jmsCorrelationID: null
      jmsReplyTo : null
      jmsType : null
      jmsRedelivered : false
      jmsProperties : {TJMSID=15b9e68:10c1f5c4b6e:-7f13, api=checkAdapterServerStatus}
      jmsPropReadWrite: true
      msgReadOnly : false
      producerClientId: ID:7
      }
      Body {
      text :
      }
      }


      I want to know, whether the receive method of queue will behave differently in the different servers r any other issue ..
      Do let me know if u need any other details.

      Pls do the need full.


      Noor.