jms activemq ;sending message to the already existing remote queue

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);
narcist527Asked:
Who is Participating?
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.

mccarlIT Business Systems Analyst / Software DeveloperCommented:
Can you send the full code that you used? This is so we can run it and check for ourselves.

Can you tell us what version of ActiveMQ you are using?

Can you post the full exception message AND stack trace that you get?
0
narcist527Author Commented:
@mccarl,
first off thanks for reply.

as a automation testing engineer, I am working on automating this process. so I was provided with jndi url, connection factory string , queues and topics. I have been trying to send the message to already existing queues. These are remote queues. I replaced the parameters in that code snippet with the appropriate values and it is throwing the below error. appreciate your time and help

javax.jms.JMSException: Wire format negotiation timeout: peer did not send his wire format.
      at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)
      at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1206)
      at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1289)
      at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:295)
      at org.apache.activemq.ActiveMQConnection.createQueueSession(ActiveMQConnection.java:1143)
      at com.swa.jmsmessages.SendingJmsMsg.main(SendingJmsMsg.java:82)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.io.IOException: Wire format negotiation timeout: peer did not send his wire format.
      at org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:94)
      at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:40)
      at org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:74)
      at org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:79)
      at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1195)
      ... 9 more
0
mccarlIT Business Systems Analyst / Software DeveloperCommented:
so I was provided with jndi url, connection factory string , queues and topics
Based off your other questions, can I assume that these details pertain to the remote Tibco JMS broker?

I replaced the parameters in that code snippet with the appropriate values
And if my above assumption is correct, are you saying that you replaced the parameters in the above (ActiveMQ specific) code with these (Tibco specific) parameters that you were given?


If the above two assumptions are correct, then NO it's never going to work. You can't use ActiveMQ client to connect to a Tibco broker. Yes they both implement the JMS standard but JMS is a bit different to what you may be expecting... it is an API standard only not a wire/protocol standard.

You need (as you asked in a different question) the Tibco client jars as they know how to talk Tibco's protocol to the Tibco broker. Nothing else will work other than that. So, you need to ask for those jar files from whoever gave you the broker/queue details, or from whoever administers the broker/server.
0

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
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
Java

From novice to tech pro — start learning today.