need help in putting xml message in jms mq queue using java

Hi all, I am new to jms  and have been working on automation testing. on my current project I was assigned to jms related testing which is new to me. could someone help me with code snippets and useful links? I am going through stackoverflow and other sites to better understand jms concepts and xml parsing as well?

Thanks in advance
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Easiest way to do it is use Stomp client.

However your infrastructure needs to support stomp protocol.

Alternatively just knock up a simple Spring JMS template

 public void sendMessage(final String message) throws JMSException {"message = " + message);

        this.jmsTemplate.send(new MessageCreator() {
            public Message createMessage(final Session session) throws JMSException {
                final TextMessage tm = session.createTextMessage();
                return tm;

    private ConnectionFactory getConnectionFactory(final String host, final int port) throws JMSException {

      //create an implementation of your connection factory here using the propiertary jar file you have.
    //you will have instructions from the JMS provider.
        return connectionFactory;

Open in new window

narcist527Author Commented:
thanks for your quick reply.  can we send message without template or configuration set up? can you help me out in testing perspective?  I was given with queue url, connectionfactory name, queue name and authentication credentials as well and was told to push simple text message in that queue to see if message is being sent successfully. I was even told that I do not need to worry about admin side configuration set up.
I would look into the link I gave you and try stomp client.
narcist527Author Commented:
Sure I will go through that link and come up with solution hopefully

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
narcist527Author Commented:
thanks for guiding me to that useful link
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.