You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Brian Munroe <br...@gmail.com> on 2008/03/03 19:52:35 UTC

JMX over HTTP - How to?

I'm interested in configuring ActiveMQ to use the HTTP(S) transport,
but I'm getting a bit cross-eyed regarding REST, HTTP(S) transports
and AJAX.

>From what I understand, if I only have pure JMS clients, I can safely
use the HTTP(S) transports without having to deal with REST or AJAX?
I'm very new to both JMS and ActiveMQ, so I need some serious hand
holding.

I think I can figure out how to set up the HTTP(S) transports, but how
would I modify my clients to use them?  I'm trying to use the examples
ProducerTool.java and ConsumerTool.java (provided in
$ACTIVEMQ_HOME/examples/src) as my basis, but if someone has simpler
examples, by all means, fire away.

I know these are driven off of the build.xml, but I was just going to
try and hard code the URLs for now.

thanks

-- brian

Re: JMX over HTTP - How to?

Posted by Brian Munroe <br...@gmail.com>.
On Mon, Mar 3, 2008 at 2:27 PM, ttmdev <jo...@ttmsolutions.com> wrote:

>
>  I'm not an expert in this area, but I don't think anything gets serialized
>  to XML when JMS client and broker are communicating over an http transport.
>  I would venture to guess that in this scenario the OpenWire protocol is
>  being tunneled through http.
>

Well, I'm not an expert either, but my guess is if OpenWire is a
binary format, I'd think it would *have* to get serialized so that it
could use HTTP.  I'll have to do a wireshark capture to prove it to
myself.

I've been drinking too much coffee today  -earlier I piggy-backed onto
this thread, asking a JBoss + ActiveMQ question.  I probably shouldn't
have done that, *but* I was able to figure out my problems.  I just
had to throw a few more *.jars in the active-mq-rar directory and
things seem to work (or at least my simple producer/consumer examples
work OK)

Again, thanks for the help.

-- brian

Re: JMX over HTTP - How to?

Posted by ttmdev <jo...@ttmsolutions.com>.
Hhmm, I guess you could use the Apache mod_proxy module to forward
requests/responses to/from the broker.  

I'm not an expert in this area, but I don't think anything gets serialized
to XML when JMS client and broker are communicating over an http transport.
I would venture to guess that in this scenario the OpenWire protocol is
being tunneled through http.  

http://activemq.apache.org/openwire-version-2-specification.html

Joe
www.ttmsolutions.com


Brian Munroe-2 wrote:
> 
> On Mon, Mar 3, 2008 at 11:17 AM, ttmdev <jo...@ttmsolutions.com>
> wrote:
> 
>>  The following jar files are required in the CLASSPATH for clients:
>>
>>  $ACTIVEMQ_HOME/activemq-all-<version>.jar
>>  $ACTIVEMQ_HOME/lib/optional/commons-httpclient-<version>.jar
>>  $ACTIVEMQ_HOME/lib/optional/xstream-<version>.jar
>>  $ACTIVEMQ_HOME/lib/optional/xmlpull-<version>.jar
>>
> 
> Thanks Joe.
> 
> Now here is a wild one.  Can I proxy this traffic through Apache
> httpd?  My gut feeling says yes, but that is my gut (and it's been
> know to be wrong)
> 
> When using the HTTP transport, what is the payload format of the
> messages?  I thought I read somewhere that it gets serialized into
> XML?  Can I use this transmit binary data (serialized, of course)?
> 
> thanks again!
> 
> -- brian
> 
> 

-- 
View this message in context: http://www.nabble.com/JMX-over-HTTP---How-to--tp15810985s2354p15815661.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: JMX over HTTP - How to?

Posted by Brian Munroe <br...@gmail.com>.
Another thing I'm trying to do is integrate ActiveMQ with JBoss.  I've
gotten this [1] to work great with the TCP transport, but I'm not
having much luck getting it to use the HTTP transport.  I keep
getting:

13:27:40,050 ERROR [BrokerService] Failed to start ActiveMQ JMS
Message Broker. Reason: java.io.IOException: Transport Connector could
not be registered in JMX: Transport scheme NOT recognized: [http]

So do I need to include some additional libraries or configure JBoss
differently?

-- brian

[1] - http://activemq.apache.org/integrating-apache-activemq-with-jboss.html

On Mon, Mar 3, 2008 at 11:33 AM, Brian Munroe <br...@gmail.com> wrote:
> On Mon, Mar 3, 2008 at 11:17 AM, ttmdev <jo...@ttmsolutions.com> wrote:
>
>  >  The following jar files are required in the CLASSPATH for clients:
>  >
>  >  $ACTIVEMQ_HOME/activemq-all-<version>.jar
>  >  $ACTIVEMQ_HOME/lib/optional/commons-httpclient-<version>.jar
>  >  $ACTIVEMQ_HOME/lib/optional/xstream-<version>.jar
>  >  $ACTIVEMQ_HOME/lib/optional/xmlpull-<version>.jar
>  >
>
>  Thanks Joe.
>
>  Now here is a wild one.  Can I proxy this traffic through Apache
>  httpd?  My gut feeling says yes, but that is my gut (and it's been
>  know to be wrong)
>
>  When using the HTTP transport, what is the payload format of the
>  messages?  I thought I read somewhere that it gets serialized into
>  XML?  Can I use this transmit binary data (serialized, of course)?
>
>  thanks again!
>
>  -- brian
>

Re: JMX over HTTP - How to?

Posted by Brian Munroe <br...@gmail.com>.
On Mon, Mar 3, 2008 at 11:17 AM, ttmdev <jo...@ttmsolutions.com> wrote:

>  The following jar files are required in the CLASSPATH for clients:
>
>  $ACTIVEMQ_HOME/activemq-all-<version>.jar
>  $ACTIVEMQ_HOME/lib/optional/commons-httpclient-<version>.jar
>  $ACTIVEMQ_HOME/lib/optional/xstream-<version>.jar
>  $ACTIVEMQ_HOME/lib/optional/xmlpull-<version>.jar
>

Thanks Joe.

Now here is a wild one.  Can I proxy this traffic through Apache
httpd?  My gut feeling says yes, but that is my gut (and it's been
know to be wrong)

When using the HTTP transport, what is the payload format of the
messages?  I thought I read somewhere that it gets serialized into
XML?  Can I use this transmit binary data (serialized, of course)?

thanks again!

-- brian

Re: JMX over HTTP - How to?

Posted by ttmdev <jo...@ttmsolutions.com>.
Yes, if you're using a pure JMS client you can use the http transport w/out
having to deal with REST or AJAX. For example, if you're using the JNDI, you
can place the following brokerURL in your jndi.properties file. 

connection.httpConnectionFactory.brokerURL = http://host01:61616

>From your JMS client, you would then lookup the connection factory called,
'httpConnectionFactory'. 

In the broker XML file, you'll have to setup a http transport as follows:

<transportConnector name="http"     uri="http://host01:61616"/>

The following jar files are required in the CLASSPATH for clients:

$ACTIVEMQ_HOME/activemq-all-<version>.jar
$ACTIVEMQ_HOME/lib/optional/commons-httpclient-<version>.jar
$ACTIVEMQ_HOME/lib/optional/xstream-<version>.jar
$ACTIVEMQ_HOME/lib/optional/xmlpull-<version>.jar

You'll have to use the keytool for setting up the https and ssl transports.

http://activemq.apache.org/how-do-i-use-ssl.html

http://activemq.apache.org/ssl-transport-reference.html

Joe
www.ttmsolutions.com 
 


Brian Munroe-2 wrote:
> 
> I'm interested in configuring ActiveMQ to use the HTTP(S) transport,
> but I'm getting a bit cross-eyed regarding REST, HTTP(S) transports
> and AJAX.
> 
> From what I understand, if I only have pure JMS clients, I can safely
> use the HTTP(S) transports without having to deal with REST or AJAX?
> I'm very new to both JMS and ActiveMQ, so I need some serious hand
> holding.
> 
> I think I can figure out how to set up the HTTP(S) transports, but how
> would I modify my clients to use them?  I'm trying to use the examples
> ProducerTool.java and ConsumerTool.java (provided in
> $ACTIVEMQ_HOME/examples/src) as my basis, but if someone has simpler
> examples, by all means, fire away.
> 
> I know these are driven off of the build.xml, but I was just going to
> try and hard code the URLs for now.
> 
> thanks
> 
> -- brian
> 
> 

-- 
View this message in context: http://www.nabble.com/JMX-over-HTTP---How-to--tp15810985s2354p15811506.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.