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 {
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?
narcist527Author Commented:
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(
      at org.apache.activemq.ActiveMQConnection.syncSendPacket(
      at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(
      at org.apache.activemq.ActiveMQConnection.createSession(
      at org.apache.activemq.ActiveMQConnection.createQueueSession(
      at com.swa.jmsmessages.SendingJmsMsg.main(
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(
      at java.lang.reflect.Method.invoke(
      at com.intellij.rt.execution.application.AppMain.main(
Caused by: Wire format negotiation timeout: peer did not send his wire format.
      at org.apache.activemq.transport.WireFormatNegotiator.oneway(
      at org.apache.activemq.transport.MutexTransport.oneway(
      at org.apache.activemq.transport.ResponseCorrelator.asyncRequest(
      at org.apache.activemq.transport.ResponseCorrelator.request(
      at org.apache.activemq.ActiveMQConnection.syncSendPacket(
      ... 9 more
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.

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

From novice to tech pro — start learning today.