activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fancellu <>
Subject Cannonical class to receive file?
Date Wed, 20 Dec 2006 13:24:45 GMT

I see

So I write a sample prog:

ActiveMQConnectionFactory connectionFactory = new
ActiveMQConnection  connection = (ActiveMQConnection
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination destination = session.createQueue(q);

Map props=new HashMap();        	
OutputStream out =
copy(new FileInputStream(file),out);     	

This seems to work, taking a 3.3MB file, it sets the queue size to 55, and
via JMX I see BrowseMessages shows 1 message, as browseAsTable shows lots of
CompositeData[] records.

Now the problem is receiving the file. It appears to arrive as lots of
little ActiveMQBytesMessage messages,
which is odd as I expected one message, as shown via BrowseMessages.

I'd rather I took it as one message with an inputstream I can read from. Is
this possible?

What is the canoncial piece of code to receive the 3.3MB file and write it
down to disk?

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message