Discussion:
How to connect ActiveMQ client to a Broker thru a firewall?
djfrisch
2011-08-16 21:24:05 UTC
Permalink
Hi,

I have an ActiveMQ 5.5.0 broker running on Windows 2008 with
transportConnector name="openwire" uri="tcp://host.domain:61616". I need to
publish messages to this broker from a standalone java client on the other
side of a firewall. Port 61616 for the broker host has been opened in the
firewall. When I try to publish the test message thru the firewall, the
application seems to hang and then times out:

Debug: [Failed to send message with error 'Could not connect to broker URL:
tcp://doedvlp.greenops.com:61616. Reason: java.net.SocketTimeoutException:
connect timed out'.]
javax.jms.JMSException: Could not connect to broker URL:
tcp://doedvlp.greenops.com:61616. Reason: java.net.SocketTimeoutException:
connect timed out
at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:286)
at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:185)
at
com.greenheck.doe.testing.ActiveMqTestSend.<init>(ActiveMqTestSend.java:22)
at
com.greenheck.doe.testing.ActiveMqTestSend.main(ActiveMqTestSend.java:10)
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at
org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:484)
at
org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:447)
at
org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
at
org.apache.activemq.transport.InactivityMonitor.start(InactivityMonitor.java:126)
at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:58)
at
org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)
at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:58)
at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:58)
at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:266)

The firewall monitor does not show any traffic being blocked and the test
application works when it is on the same side of the firewall as the broker.

Can any one give many any pointers on how to get this to work thru the
firewall or point me to some documentation on how to do it?

Dave

--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-connect-ActiveMQ-client-to-a-Broker-thru-a-firewall-tp3748504p3748504.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Aleksandar Ivanisevic
2011-08-17 07:35:39 UTC
Permalink
Post by djfrisch
Hi,
I have an ActiveMQ 5.5.0 broker running on Windows 2008 with
transportConnector name="openwire" uri="tcp://host.domain:61616". I need to
publish messages to this broker from a standalone java client on the other
side of a firewall. Port 61616 for the broker host has been opened in the
firewall. When I try to publish the test message thru the firewall, the
Only 61616 needs to be opened for TCP, I have dozens of setups like this.

try "telnet host.domain 61616" from the command prompt and if you get
a timeout then the firewall is not open. If you don't get a timeout
but a successful connect, ask your firewal admins if they have "smart
defense" features turned on.

[...]
Don Santillan
2011-08-17 13:26:50 UTC
Permalink
Hello,

I'm just curious on the consumer count I'm getting using the statistics
plugin. I use the plugin to get some statistics like the number of
consumers bound to a queue and a broker.

I am setting a queue to have 10 consumers. Getting the queue and broker
statistics, I get 10 consumers coming from the queue and 24 consumers
coming from the broker.

When I increase the number of consumers bound to the queue, like 100
consumers, I get 100 consumers in the queue and 204 consumers in the
broker using the statistics plugin. Why is this happening? Why is the
consumer doubled in the broker consumer count?

I'm using ActiveMQ 5.5.0 by the way

-don
Gary Tully
2011-08-17 16:34:38 UTC
Permalink
if each consumer uses a new connection, there will be an advisor
consumer per connection.

use ?jms.watchTopicAdvisories=false on the broker url to remove them.
They are used to have an early indication of temp queue
creation/deletion.
Post by Don Santillan
Hello,
I'm just curious on the consumer count I'm getting using the statistics
plugin. I use the plugin to get some statistics like the number of consumers
bound to a queue and a broker.
I am setting a queue to have 10 consumers. Getting the queue and broker
statistics, I get 10 consumers coming from the queue and 24 consumers coming
from the broker.
When I increase the number of consumers bound to the queue, like 100
consumers, I get 100 consumers in the queue and 204 consumers in the broker
using the statistics plugin. Why is this happening? Why is the consumer
doubled in the broker consumer count?
I'm using ActiveMQ 5.5.0 by the way
-don
--
http://fusesource.com
http://blog.garytully.com
Don Santillan
2011-08-18 05:56:23 UTC
Permalink
Thanks Gary, I can see the broker consumer count changed after adding it
in the broker url.

Does having an advisor consumer per connection affect consumer
performance? I asked this because currently, we're getting high message
queue count once in a while.
Post by Gary Tully
if each consumer uses a new connection, there will be an advisor
consumer per connection.
use ?jms.watchTopicAdvisories=false on the broker url to remove them.
They are used to have an early indication of temp queue
creation/deletion.
Post by Don Santillan
Hello,
I'm just curious on the consumer count I'm getting using the statistics
plugin. I use the plugin to get some statistics like the number of consumers
bound to a queue and a broker.
I am setting a queue to have 10 consumers. Getting the queue and broker
statistics, I get 10 consumers coming from the queue and 24 consumers coming
from the broker.
When I increase the number of consumers bound to the queue, like 100
consumers, I get 100 consumers in the queue and 204 consumers in the broker
using the statistics plugin. Why is this happening? Why is the consumer
doubled in the broker consumer count?
I'm using ActiveMQ 5.5.0 by the way
-don
Gary Tully
2011-08-18 09:14:56 UTC
Permalink
only if you are a heavy user of temp destinations.
Thanks Gary, I can see the broker consumer count changed after adding it in
the broker url.
Does having an advisor consumer per connection affect consumer performance?
I asked this because currently, we're getting high message queue count once
in a while.
Post by Gary Tully
if each consumer uses a new connection, there will be an advisor
consumer per connection.
use ?jms.watchTopicAdvisories=false on the broker url to remove them.
They are used to have an early indication of temp queue
creation/deletion.
Post by Don Santillan
Hello,
I'm just curious on the consumer count I'm getting using the statistics
plugin. I use the plugin to get some statistics like the number of consumers
bound to a queue and a broker.
I am setting a queue to have 10 consumers. Getting the queue and broker
statistics, I get 10 consumers coming from the queue and 24 consumers coming
from the broker.
When I increase the number of consumers bound to the queue, like 100
consumers, I get 100 consumers in the queue and 204 consumers in the broker
using the statistics plugin. Why is this happening? Why is the consumer
doubled in the broker consumer count?
I'm using ActiveMQ 5.5.0 by the way
-don
--
http://fusesource.com
http://blog.garytully.com
djfrisch
2011-08-17 16:14:04 UTC
Permalink
Hi Aleksander,

Thanks for your reply.

It appears that we are able to get through the corporate firewall and that
the connection is being blocked by the broker's host (Windows 2008). We are
investigating that now.

Dave

--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-connect-ActiveMQ-client-to-a-Broker-thru-a-firewall-tp3748504p3750436.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
djfrisch
2011-08-23 15:39:20 UTC
Permalink
It turns out there was a misconfigured setting in the firewall.

Dave

--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-connect-ActiveMQ-client-to-a-Broker-thru-a-firewall-tp3748504p3763121.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Loading...