[jboss-user] [JBoss Messaging] - ((BytesMessage)message).readBytes(...) on a redelivered Byte

plesur do-not-reply at jboss.com
Fri Apr 18 06:50:39 EDT 2008


JBoss 4.2.2.GA
JBoss Messaging 1.4.0.SP3
JBoss Remoting 2.2.2.SP7

Hi,

my 'payload'-bytearray (see below) which has been declared and initialized via:
byte[] payload = new byte[(int)bytesmessage.getBodyLength()]; 
has the right size ((int)bytesmessage.getBodyLength() still returns the correct size of a redelivered BytesMessage's payload).

But then calling bytesmessage.readBytes(payload) method on a redelivered BytesMessage results in a strange behavior (maybe only strange for me:) - the 'payload'-bytearray is still initialized although as I can see when I debug my project the JBossBytesMessage.payloadAsByteArray[] property (private) isn't empty and holds the right content.

It plays not matter if I'm testing with standalone remote MessageListener-ClientApplications or under deployed MDBs - same behavior.


  | public void onMessage( Message message )
  | {	
  | 	try 
  | 	{		
  | 		if (message instanceof BytesMessage) 
  | 		{			
  | 			// Create bytemessage object to hold the content of the bytemessage
  | 			BytesMessage bytesmessage = (BytesMessage)message;
  | 			
  | 			// Create bytearray in size of the bytemessage
  | 			byte[] payload = new byte[(int)bytesmessage.getBodyLength()]; 
  | 						
  | 			// Read the bytemessage
  | 			bytesmessage.readBytes(payload);
  | 
  |                         .
  |                         .
  |                         .
  | 

It sounds a bit like:
http://jira.jboss.org/jira/browse/JBMESSAGING-1079
but this is old and should be fixed since 1.4.0.SP1

Can someone replicate this - or am I doing something wrong?

Thanks in advance!


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4145114#4145114

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4145114



More information about the jboss-user mailing list