4 Replies Latest reply on Aug 27, 2009 4:30 PM by clebert.suconic

    BETA5 - setObjectProperty(

    simon_temple

      The manual states that:

      Setting the OutputStream could also be done in a non blocking way using the property JMS_HQ_InputStream.

      // This won't wait the stream to finish. You need to keep the consumer active.
      messageReceived.setObjectProperty("JMS_HQ_InputStream", bufferedOutput);


      But you get a:

      javax.jms.JMSException: MessageNotWriteableException - Message is read-only
      


      The method setObjectProperty in HornetQMessage does not support "the non blocking way".

      Is is a problem with the documentation or the implementation?

      wdyt?

        • 1. Re: BETA5 - setObjectProperty(
          clebert.suconic

          On received messages, you can only set JMS_HQ_OutputStream or JMS_HQ_SaveStream.


          You probably tried to set JMS_HQ_InputStream on a received message.

          InputStream is what will feed the message.. so that would change the message hence you're getting an exception.


          Look at the LargeMessage example. That' s working correctly.

          • 2. Re: BETA5 - setObjectProperty(
            timfox

             

            "clebert.suconic@jboss.com" wrote:
            On received messages, you can only set JMS_HQ_OutputStream or JMS_HQ_SaveStream.


            You probably tried to set JMS_HQ_InputStream on a received message.

            InputStream is what will feed the message.. so that would change the message hence you're getting an exception.


            Look at the LargeMessage example. That' s working correctly.


            Agreed, but you should consider throwing a more descriptive error message, so the user knows what is going.

            • 3. Re: BETA5 - setObjectProperty(
              simon_temple

              I think the manual states I should use: JMS_HQ_InputStream when I really need to use JMS_HQ_OutputStream for a received message.

              ...at least that's the way I read it.

              Would you mind looking at the manual to ensure I've not just misinterpreted something?

              • 4. Re: BETA5 - setObjectProperty(
                clebert.suconic

                yeah.. thanks.. there is a typo on the doc.


                Sorry about the inconvenience.


                I will also add a more descriptive error instead of just ReadOnly.