Reputation: 55
Im desperately trying to connect to my local ActiveMQ broker with a JMS client over http.
The ActiveMQ web console is reachable over my dynamic ip address.
The transport connector in the xml config should be correct i think?
<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="http1" uri="http://localhost:8080"/>
</transportConnectors>
connecting over "http://localhost:8080" is working though.
but if i use my web ip which leads to my router and is forwarded to my pc with (port is correct) the connection is not working.
public static String curIPurl = "http://{currentIP:port}";
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(curIPurl);
TopicConnection connection = connectionFactory.createTopicConnection();
connection.start();
if i debug the jvm is stuck in the createTopicConnection method and after some time the rest of the code is skipped and the main method finishes without any message exception or whatever.
Any guesses what iam doing wrong?
Thanks
Upvotes: 2
Views: 2487
Reputation: 7952
Change
<transportConnector name="http1" uri="http://localhost:8080"/>
to
<transportConnector name="http1" uri="http://0.0.0.0:8080"/>
I have not used the http transport - only the tcp transport, but that's how I specify the address when I want remote JMS clients to be able to connect. When you bind to localhost then you can only connect from localhost. When you bind to 0.0.0.0 you can still connect from localhost but you can also connect from any remote address.
Upvotes: 3