activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eduardo Montoya <hm14...@hotmail.com>
Subject problems reading a cms::BytesMessage.
Date Thu, 19 Feb 2009 18:06:03 GMT

Hello,

I have some problems when reading a cms::BytesMessage.

first of all, my client code looks like:

void MyMessageListener::onMessage( const Message* message )
{
    const BytesMessage* b = dynamic_cast<const BytesMessage*>( message );
    if (b != NULL)
    {
        std::size_t len = b->getBodyLength(); // this line compiles and works.

        int i = b->readInt(); // this compiles but gives me an exception.
        // message is in write-only mode ....

        // then i tried to execute the following line to set the input stream to read-only
        b->reset(); // this line does not compile.

        // VC++ 2008 express edition compiler says:
        // error C2662: 'cms::BytesMessage::reset' : cannot convert 'this' pointer from 'const
        // cms::BytesMessage' to 'cms::BytesMessage &'

    }
}

i found the following issue:

https://issues.apache.org/activemq/browse/AMQCPP-143

but it talks only about readXXX methods.
not about reset method.

could anyone give me any advice to resolve this problem?

thank a lot for all your replies.

Kind Regards,

Eduardo


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message