ActiveMQ Java Broker, Python Client
<p>I have for legacy reasons a Java activeMQ implementation of the Broker/Publisher over vanilla tcp transport protocol. I wish to connect a Python client to it, however all the "stomp" based documentation doesn't seem to have it, not over the stomp protcol, and when I try the basic examples I get the error on the Java Broker side:</p>

<pre><code>[ActiveMQ Transport: tcp:///127.0.0.1:62860@5001] WARN org.apache.activemq.broker.TransportConnection.Transport - Transport Connection to: tcp://127.0.0.1:62860 failed: java.io.IOException: Unknown data type: 80
</code></pre>

<p>The Broker code is very vanilla in Java:</p>

<pre><code>    String localVMurl = "vm://localhost";
    String remoterURL = "tcp://localhost:5001";
    BrokerService broker = new BrokerService();
    broker.addConnector(localVMurl); 
    broker.addConnector(remoterURL);
    broker.setAdvisorySupport(true);
    broker.start();


    ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(localVMurl+"?create=false");
    Connection connection = connectionFactory.createConnection();
</code></pre>

<p>and the Python just fails. I can't seem to find anything online using just basic "tcp://localhost:" connections from Python. Am I doing something wrong here?  </p>

<pre><code>import stomp

class MyListener(stomp.ConnectionListener):
    def on_error(self, headers, message):
        print('received an error "%s"' % message)
    def on_message(self, headers, message):
        print('received a message "%s"' % message)

    conn = stomp.Connection(host_and_ports = [('localhost', 5001)])
    conn.start()
    conn.connect('admin', 'password', wait=True)
</code></pre>

<p>and I get the error:</p>

<pre><code>IndexError: list index out of range
</code></pre>

<p>Without seeing the broker configuration it is a bit tricky to answer but from the error I'd guess you are trying to connect a STOMP client to the OpenWire transport which won't work, you need to have a STOMP TransportConnector configured on the broker and point the STOMP client there.</p>

<p>See the <a href="http://activemq.apache.org/stomp.html" rel="nofollow">ActiveMQ STOMP</a> documentation.</p>

<p>To add STOMP support for an embedded broker you'd do something along the lines of:</p>

<pre><code>brokerService.addConnector("stomp://0.0.0.0:61613");
</code></pre>

java python tcp activemq stomp