[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Large messages broken

clebert.suconic@jboss.com do-not-reply at jboss.com
Sat Apr 4 22:57:33 EDT 2009


I was able to send and receive 500 * 1024 * 1024 bytes, if removing one reference of the memory (that would use 500M of memory):


Index: src/org/jboss/jms/example/LargeMessageExample.java
  | ===================================================================
  | --- src/org/jboss/jms/example/LargeMessageExample.java	(revision 6312)
  | +++ src/org/jboss/jms/example/LargeMessageExample.java	(working copy)
  | @@ -68,10 +68,12 @@
  |  
  |           //Step 7. Create a BytesMessage with 1MB arbitrary bytes
  |           BytesMessage message = session.createBytesMessage();
  | -         message.writeBytes(new byte[1024 * 1024]);
  | +         message.writeBytes(new byte[500 * 1024 * 1024]);
  |           
  |           //Step 8. Send the Message
  |           producer.send(message);
  | +
  | +         message = null;
  |           
  |           System.out.println("Large Message sent");
  |           
  | @@ -84,7 +86,7 @@
  |           connection.start();
  |  
  |           //Step 11. Receive the message
  | -         BytesMessage messageReceived = (BytesMessage) messageConsumer.receive(5000);
  | +         BytesMessage messageReceived = (BytesMessage) messageConsumer.receive(120000);
  |  
  |           System.out.println("Received message: " + messageReceived.getBodyLength() + " bytes");
  | 


And by adding more memory on the VM:

Index: jms/common/build.xml
  | ===================================================================
  | --- jms/common/build.xml	(revision 6312)
  | +++ jms/common/build.xml	(working copy)
  | @@ -104,7 +104,8 @@
  |     <target name="runExample" depends="compile">
  |        <java classname="${example.classname}" fork="true" resultproperty="example-result">
  |           <jvmarg value="-XX:+UseParallelGC"/>
  | -         <jvmarg value="-Xms512M"/>
  | +         <jvmarg value="-verbose:gc"/>
  | +         <jvmarg value="-Xms1024M"/>
  |           <jvmarg value="-Xmx2048M"/>
  |           <jvmarg value="-XX:+AggressiveOpts"/>
  |           <jvmarg value="-XX:+UseFastAccessorMethods"/>
  | 



I rememver having a conversation with you about supporting ClientFiles through JMS, and I remember we deciding on support that thorugh the core-api.

If we do want to expose it thorugh JMS, we would need some special methods to specify the Client directory.. and how to add a fileHandle to a message. (Or maybe having StreamMessage storing the data on a temporary file).



I will do a little more extensive testing on monday to make sure nothing is broken.

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

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



More information about the jboss-dev-forums mailing list