narcist527
asked on
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=connection Factory.cr eateQueueC onnection( );
session=queueConnection.cr eateQueueS ession(fal se,QueueSe ssion.AUTO _ACKNOWLED GE);
queue=session.createQueue( TEST_QUEUE _NAME);
sender=session.createSende r(queue);
sender.setDeliveryMode(Del iveryMode. PERSISTENT );
message=session.createText Message(St ring.value Of(i));
sender.send(message);
any help is highly appreciated
QueueConnectionFactory connectionFactory=new ActiveMQConnectionFactory(
QueueConnection queueConnection=null;
QueueSession session=null;
QueueSender sender=null;
Queue queue=null;
TextMessage message=null;
try {
queueConnection=connection
session=queueConnection.cr
queue=session.createQueue(
sender=session.createSende
sender.setDeliveryMode(Del
message=session.createText
sender.send(message);
ASKER
@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.J MSExceptio nSupport.c reate(JMSE xceptionSu pport.java :62)
at org.apache.activemq.Active MQConnecti on.syncSen dPacket(Ac tiveMQConn ection.jav a:1206)
at org.apache.activemq.Active MQConnecti on.ensureC onnectionI nfoSent(Ac tiveMQConn ection.jav a:1289)
at org.apache.activemq.Active MQConnecti on.createS ession(Act iveMQConne ction.java :295)
at org.apache.activemq.Active MQConnecti on.createQ ueueSessio n(ActiveMQ Connection .java:1143 )
at com.swa.jmsmessages.Sendin gJmsMsg.ma in(Sending JmsMsg.jav a:82)
at sun.reflect.NativeMethodAc cessorImpl .invoke0(N ative Method)
at sun.reflect.NativeMethodAc cessorImpl .invoke(Na tiveMethod AccessorIm pl.java:62 )
at sun.reflect.DelegatingMeth odAccessor Impl.invok e(Delegati ngMethodAc cessorImpl .java:43)
at java.lang.reflect.Method.i nvoke(Meth od.java:49 7)
at com.intellij.rt.execution. applicatio n.AppMain. main(AppMa in.java:14 0)
Caused by: java.io.IOException: Wire format negotiation timeout: peer did not send his wire format.
at org.apache.activemq.transp ort.WireFo rmatNegoti ator.onewa y(WireForm atNegotiat or.java:94 )
at org.apache.activemq.transp ort.MutexT ransport.o neway(Mute xTransport .java:40)
at org.apache.activemq.transp ort.Respon seCorrelat or.asyncRe quest(Resp onseCorrel ator.java: 74)
at org.apache.activemq.transp ort.Respon seCorrelat or.request (ResponseC orrelator. java:79)
at org.apache.activemq.Active MQConnecti on.syncSen dPacket(Ac tiveMQConn ection.jav a:1195)
... 9 more
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.J
at org.apache.activemq.Active
at org.apache.activemq.Active
at org.apache.activemq.Active
at org.apache.activemq.Active
at com.swa.jmsmessages.Sendin
at sun.reflect.NativeMethodAc
at sun.reflect.NativeMethodAc
at sun.reflect.DelegatingMeth
at java.lang.reflect.Method.i
at com.intellij.rt.execution.
Caused by: java.io.IOException: Wire format negotiation timeout: peer did not send his wire format.
at org.apache.activemq.transp
at org.apache.activemq.transp
at org.apache.activemq.transp
at org.apache.activemq.transp
at org.apache.activemq.Active
... 9 more
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you tell us what version of ActiveMQ you are using?
Can you post the full exception message AND stack trace that you get?