• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can we send a file to MQ  RSS feed

 
sadish kumar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working with Active MQ.. I need to send a file to MQ.. Previously i have written the contents of the file to bytes message and send it... But the client needs we should send the file as it is to MQ.
For example i need to send a xml file to MQ. In MQ, the file should not be in bytes.. Instead of that it should be a xml file in queue. Can anyone help me... Is it possible in java...
 
Sandeep Murthy
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The apache ActiveMQ website says that active mq fully supports JMS 1.1.
As per the specifications, JMS supports text messages.
Text messages are basically Strings, which you can use to post the contents of your XML file to the queue(or topic).

As per JMS API specs, a text message can be created as follows:
TextMessage message = session.createTextMessage();
message.setText(msg_text);

I have used IBM Websphere MQ. It is very much possible to post text data to queues usting it. In fact, posting XML file content as text data is one of the most used approaches in enterprise applications.

You could explore the ActiveMQ API, and try to find a way to post text messages. Conceptually, with Java, it is definitely possible.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!