We help IT Professionals succeed at work.
Get Started

jms activemq ;sending message to the already existing remote queue

narcist527
narcist527 asked
on
836 Views
Last Modified: 2015-07-17
I am trying to send a message to already existing queue and using the below code and not working. I found this on internet and playing around this. here he is creating queue . But I want to send a message without creating queue. it was throwing an error " javax.jms.JMSException: Wire format negotiation timeout: peer did not send his wire format."

any help is highly appreciated

QueueConnectionFactory connectionFactory=new ActiveMQConnectionFactory("vm://test");
  QueueConnection queueConnection=null;
  QueueSession session=null;
  QueueSender sender=null;
  Queue queue=null;
  TextMessage message=null;
  try {
    queueConnection=connectionFactory.createQueueConnection();
    session=queueConnection.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE);
    queue=session.createQueue(TEST_QUEUE_NAME);
    sender=session.createSender(queue);
    sender.setDeliveryMode(DeliveryMode.PERSISTENT);
    message=session.createTextMessage(String.valueOf(i));
    sender.send(message);
Comment
Watch Question
IT Business Systems Analyst / Software Developer
CERTIFIED EXPERT
Top Expert 2015
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE