Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to pass an xml file as message in JMS  RSS feed

 
Vidya Gupta
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dear All,

I am new to the JMS technology. I have written one sample sender and receiver program to pass a string message to the JMS queue and retrieve it back. It is working fine as well. But now, I want to pass a xml file to the JMS queue. Then from there I need to read the XML file and convert it into a Java object Using Jaxb. I know how to convert an XML into java object using Jaxb. But i am unable to send the XML file as a jms message to the listener. Please give me some suggestions.

I tried a lot by googling it, but did not get a proper solution for this issue. Request you all to help me to resolve this issue. I am using jboss-soa-p-5 sever.

Thanks,
Vidya
 
Michael Remijan
Author
Ranch Hand
Posts: 131
7
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do this in a number of ways. 1) if it is all on the same server, you an pass the fully qualified path on the file system as a string and the MDB and read the file that way. 2) you can read the contents of the entire xml document into a string then pass that to the MDB just like any other string. 2) you can read the contents of the xml into something like a buffered string reader and instead of sending a string message you can send an object message to the MDB and typecaset the object back to the buffered string reader
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!