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

    Recieving message from a queue

    nooreazam

      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.


        • 1. Re: Recieving message from a queue
          genman

          What exception?

          • 2. Re: Recieving message from a queue
            nooreazam

            Thanx for ur reply.

            The exception we r throwing is, our application defined exception with some error code. This one we r throwing when the receiced message is null.

            Also i have a doubt, in my log file iam getting the following line, when we create the queue session..

            SpySession@28142411[tx=true txid=-9223372036854775808 RUNNING connection=Connection@6237616[token=ConnectionToken:ID:3/370ab06091c471a960b32e3e192190b7 rcvstate=STOPPED]]

            I want to know in the above line
            - y it is giving "rcvstate=STOPPED"
            - when this will arrise.

            Do let me know, if u want both the log files, i meant to say Web logic and Jboss log files


            Waiting for ur reply.


            Noor.