activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jorge.medra" <jorge.omar.me...@gmail.com>
Subject Re: Problem With BytesMessage On Version 3.5.0
Date Wed, 16 Jan 2013 01:09:00 GMT
Hi
The problem is at the moment of read data. For example: I send by another
app (java app) a message with 32 bytes and at the moment to recive the
message the siza and buffer is wrong

For example: Whit this code:

            const TextMessage* textMessage = dynamic_cast< const
TextMessage* >( message );
            const BytesMessage* bytetMessage = dynamic_cast< const
BytesMessage* >( message );
            //const StreamMessage* bytetMessage = dynamic_cast< const
StreamMessage* >( message );
           
            string text = "";
            
            if( textMessage != NULL ) {
                text = textMessage->getText();
                std::cout << "Message " << count << " Received: " <<
text.c_str() << endl;
            }
            else if( bytetMessage != NULL ) {
                
                int size = bytetMessage->getBodyLength();
                
                std::cout << "BYTES RECIVIDOS: " << size << endl;
               
printBytesHex((char*)bytetMessage->getBodyBytes(),size,"BUFFER");
                ...
           }

Whit app 3.4.5 i get this output:

BYTES RECIVIDOS: 32
HEX INFO [BUFFER]....................
                              a3 6e a2 44 42 e3 78 43 26 95 
                              58 e6 73 a2 d3 ec d4 d8 ef 93 
                              d9 d2 d8 89 64 19 37 6b 9b 22 
                              19 d1 
                              .............................

But with api 3.5.0 the output is:


*BYTES RECIVIDOS: 59768832
Message Body is Read-Only.
	FILE: activemq/commands/ActiveMQBytesMessage.cpp, LINE: 135*


Thaht's the point!!

As i can see, this is a bug. So i will follow your recomendation to open a
case in Jira.

Thanks




--
View this message in context: http://activemq.2283324.n4.nabble.com/Problem-With-BytesMessage-On-Version-3-5-0-tp4661774p4661800.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Mime
View raw message