Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Can we send a file to MQ

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic