Passing a file using JMS
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Krishna_Kumar
Posted On:   Tuesday, March 27, 2001 02:38 AM

How do you pass a file from a message producer to a consumer using JMS?

Re: Passing a file using JMS

Posted By:   kunal_khanna  
Posted On:   Monday, April 16, 2001 01:53 PM

Hi,
I just used fileInput stream to read a file into a byte array,transmitted the array to a queue.
The consumer reads this byte array and writes it to another file.
It runs very well...

Rgds
kunal

Re: Passing a file using JMS

Posted By:   Josh_Rayls  
Posted On:   Wednesday, March 28, 2001 12:15 PM

Krishna,

I believe the best way to do this would be to use an ObjectMessage. Simply store your File object in the Message.




ObjectMessage msg =
queue_session.createObjectMessage();


msg.setObject(your_file_object);




Upon consumption, just call the msg.getObject() method to return your File object.
About | Sitemap | Contact