• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to pass an xml file as message in JMS

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 131
7
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
What's wrong? Where are you going? Stop! Read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic