Discussion:
ActiveMQ Brokers using HTTP to communicate
lyall
2009-08-20 01:58:09 UTC
Permalink
G'day.

I have ActiveMQ 5.1 working just fine using autodiscovery and multicast.

I would like to configure 2 ActiveMQ 5.1 brokers to talk to each other using
HTTP port 80, to make it easy with regards to firewalls. I assume this is
possible, I see talk about client -> Broker using HTTP and have seen posts
on Broker -> Broker using HTTP, but no concrete 'howto', that I have found,
so far.

At this time, each ActiveMQ is running on it's own server, with no other
http server, so port 80 is ok for ActiveMQ to use, although, I would like to
know if I can integrate ActiveMQ into an existing HTTP server (httpd) such
that they communicate with each other via a more complete url, rather than
simply address:port using http.


I figured if I edited activemq.xml and commented out
<networkConnector name="default-nc" uri="multicast://default"/>
and replaced it with something like
<networkConnector name="Broker1 and Broker2"
uri="static://(http://192.168.0.5:80,http://192.168.1.5:80)"/>
I might get some joy, but I keep receiving a connection refused.

WARN DiscoveryNetworkConnector - Could not start network bridge
between: vm://this-one and: http://192.168.1.5:80 due to:
java.net.ConnectException: Connection refused: connect

Is there some other step I should be doing? Maybe a jar from the
lib/optional directory needs to be moved up into the lib directory?

Thanks, in advance.

...Lyall
--
View this message in context: http://www.nabble.com/ActiveMQ-Brokers-using-HTTP-to-communicate-tp25054814p25054814.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Dejan Bosanac
2009-08-20 08:45:04 UTC
Permalink
Hi,

you need to start transport connectors as well.

Take a look at these configurations used in a test case for example

http://fisheye6.atlassian.com/browse/activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/usecases/sender-http.xml?r=HEAD
http://fisheye6.atlassian.com/browse/activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/usecases/receiver-http.xml?r=HEAD

Cheers
--
Dejan Bosanac

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net
Post by lyall
G'day.
I have ActiveMQ 5.1 working just fine using autodiscovery and multicast.
I would like to configure 2 ActiveMQ 5.1 brokers to talk to each other using
HTTP port 80, to make it easy with regards to firewalls. I assume this is
possible, I see talk about client -> Broker using HTTP and have seen posts
on Broker -> Broker using HTTP, but no concrete 'howto', that I have found,
so far.
At this time, each ActiveMQ is running on it's own server, with no other
http server, so port 80 is ok for ActiveMQ to use, although, I would like to
know if I can integrate ActiveMQ into an existing HTTP server (httpd) such
that they communicate with each other via a more complete url, rather than
simply address:port using http.
I figured if I edited activemq.xml and commented out
<networkConnector name="default-nc" uri="multicast://default"/>
and replaced it with something like
<networkConnector name="Broker1 and Broker2"
uri="static://(http://192.168.0.5:80,http://192.168.1.5:80)"/>
I might get some joy, but I keep receiving a connection refused.
WARN DiscoveryNetworkConnector - Could not start network bridge
java.net.ConnectException: Connection refused: connect
Is there some other step I should be doing? Maybe a jar from the
lib/optional directory needs to be moved up into the lib directory?
Thanks, in advance.
...Lyall
--
http://www.nabble.com/ActiveMQ-Brokers-using-HTTP-to-communicate-tp25054814p25054814.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
lyall
2009-08-21 01:01:53 UTC
Permalink
Excellent.
I have the two brokers talking using http using the configuration settings,
shown below.
I have disabled multicast as I only want the two to communicate using port
80.
Thank you.

<transportConnectors>
<transportConnector name="openwire" uri="tcp://localhost:61616"
/>
<!-- <transportConnector name="openwire"
uri="tcp://localhost:61616" discoveryUri="multicast://default"/> -->
<transportConnector name="http" uri="http://0.0.0.0:80"/>
<transportConnector name="ssl" uri="ssl://localhost:61617"/>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
<transportConnector name="xmpp" uri="xmpp://localhost:61222"/>
</transportConnectors>

<networkConnectors>
<!-- by default just auto discover the other brokers -->
<!-- !! <networkConnector name="default-nc"
uri="multicast://default"/> -->
<!-- Example of a static configuration: -->
<networkConnector name="Host1 and Host2"
uri="static://(http://192.168.1.1:80,http://192.168.1.2:80)"/>
</networkConnectors>
--
View this message in context: http://www.nabble.com/ActiveMQ-Brokers-using-HTTP-to-communicate-tp25054814p25072666.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Loading...