Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URGENT Help Needed regarding the sending XML file to the JMS Queue

 
Keerthi Kumar
Ranch Hand
Posts: 105
  • 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 print the contents of the xml file by reading it.

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 weblogic 9.2 server.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you written so far? What exceptions or unexpected behaviour is occurring?
 
Keerthi Kumar
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I just have one sample XML file. So, instead of sending a simple text message to the queue, now I need to send this XML file to the queue and retrieve back the same and display the contents of the XML file. Below is the program for sending the text message to the JMS queue.Request you to please help me to send the XML file by using the below program
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might be a good example.
 
Keerthi Kumar
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

Thanks a lot for your mail. The sample link which you had sent me works fine. But my requirement is to send the xml file (physically) to the JMS queue and retrieve it back as xml only. So, please guide me to achieve the same.

Thanks i advance !
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "send physically"?

JMS supports a bunch of message types. You can use a different type (e.g. and ObjectMessage or BytesMEssage) if you like, but sending XML as text makes the most sense to me.
 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Keerthi,

As the paul says you can do this.

You can read XML file and copy it in to a JMSText message and send it to a message queue that you want. And in that massage receiver you can implement to read that JMSText message(XML copied) and convert it into a XML file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic