Scala "Wire format" error on Receive from Queue

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Scala "Wire format" error on Receive from Queue

Justin Taylor
I have ActiveMQ running on a server.  I can connect from my PC using Python stomp.  With Scala, I get this error:
Exception in thread "main" javax.jms.JMSException: Wire format negotiation timeout: peer did not send his wire format.


I copied the Scala "Receive from Queue" sample from the Cross Language Clients page (https://activemq.apache.org/cross-language-clients).  I added my user, password and broker URL to the instantiation of the ActiveMQConnectionFactory object.  It generates the error on this line:
val sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE)

I took the error to Google it found this page "Wire format negotiation timeout - peer did not send his wire format" (https://activemq.apache.org/javaxjmsjmsexception-wire-format-negociation-timeout-peer-did-not-send-his-wire-format).  I know my port is correct because it's the same one that Python stomp can connect to.  This is a test ActiveMQ instance with no load, so it's not overworked.  That leaves the JMS appender topic (https://activemq.apache.org/how-do-i-use-log4j-jms-appender-with-activemq).  I copied the sample log4j.properties code into my project, but it didn't change anything.


Can anyone suggest what to check next?  I'd really appreciate it.


Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Scala "Wire format" error on Receive from Queue

tabish121@gmail.com
On 2/25/20 4:32 PM, Justin Taylor wrote:

> I have ActiveMQ running on a server.  I can connect from my PC using Python stomp.  With Scala, I get this error:
> Exception in thread "main" javax.jms.JMSException: Wire format negotiation timeout: peer did not send his wire format.
>
>
> I copied the Scala "Receive from Queue" sample from the Cross Language Clients page (https://activemq.apache.org/cross-language-clients).  I added my user, password and broker URL to the instantiation of the ActiveMQConnectionFactory object.  It generates the error on this line:
> val sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE)
>
> I took the error to Google it found this page "Wire format negotiation timeout - peer did not send his wire format" (https://activemq.apache.org/javaxjmsjmsexception-wire-format-negociation-timeout-peer-did-not-send-his-wire-format).  I know my port is correct because it's the same one that Python stomp can connect to.  This is a test ActiveMQ instance with no load, so it's not overworked.  That leaves the JMS appender topic (https://activemq.apache.org/how-do-i-use-log4j-jms-appender-with-activemq).  I copied the sample log4j.properties code into my project, but it didn't change anything.
>
>
> Can anyone suggest what to check next?  I'd really appreciate it.
>
>
> Thanks
>
An openwire based client cannot connect to the STOMP port unless that
port's transport connector is using the 'auto' transport. You should
check your broker configuration and either add an openwire connector or
use the that is there, likely on port 61616.

--
Tim Bish

Reply | Threaded
Open this post in threaded view
|

RE: Scala "Wire format" error on Receive from Queue

Justin Taylor
I (mistakenly) assumed that the ActiveMQ port was the same regardless of the client.  I changed to port 61616 and it connected.

Thank you



-----Original Message-----
From: Timothy Bish [mailto:[hidden email]]
Sent: Tuesday, February 25, 2020 3:46 PM
To: [hidden email]
Subject: Re: Scala "Wire format" error on Receive from Queue

An openwire based client cannot connect to the STOMP port unless that port's transport connector is using the 'auto' transport. You should check your broker configuration and either add an openwire connector or use the that is there, likely on port 61616.

--
Tim Bish