Solved

ActiveMQ and proxy connector

Posted on 2014-03-28
3
1,188 Views
Last Modified: 2014-04-01
I am reading this site:

http://activemq.apache.org/the-proxy-connector.html

and it appears to be telling me that ActiveMQ can connect to a proxy through this connector, but will not actually act as a proxy, or that ActiveMQ has no external Proxy agent.

Is this correct.  In other words do I need to purchase a Proxy, and if so which one should I select?

Can I get a proxy for ActiveMQ SSL messages for JMS ?

Thanks, njd
0
Comment
Question by:Anthony Lucia
  • 2
3 Comments
 
LVL 35

Expert Comment

by:mccarl
Comment Utility
and it appears to be telling me that ActiveMQ can connect to a proxy through this connector, but will not actually act as a proxy
No, it is actually the other way around, ie. that the port that this proxy connector has been configured to "bind" to will accept incoming connections and then proxy them on to whatever is configured as the "remote".

In other words do I need to purchase a Proxy, and if so which one should I select?

Can I get a proxy for ActiveMQ SSL messages for JMS ?
You have said nothing about why you might need a proxy in the first place, whether configured in ActiveMQ or purchased or whatever. You would need to tell us this information before we could recommend anything.
0
 

Author Comment

by:Anthony Lucia
Comment Utility
I am trying to design an ActiveMQ behind a proxy, and have been asked to look into the possibility of using a proxy to get data past the firewall

Not quite sure I understand the above post.

So far it seems that I would need to purchse a Proxy to place inside the DMZ

I still dont quite understand the proxy connector.  Can I assume it accepts incoming messages from an external proxy into ActiveMQ, and then  sends out outgoing messages to remote clients through potentially the same proxy but possibly to another ultimate destination ?

Thanks
0
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
Comment Utility
I am trying to design an ActiveMQ behind a proxy, and have been asked to look into the possibility of using a proxy to get data past the firewall

So far it seems that I would need to purchse a Proxy to place inside the DMZ
Ok, so still not a *great* amount of detail to go on, but based on this, you could look at one of these options...

 - Open up one port on the firewall to allow normal ActiveMQ tcp traffic in from the outside to your ActiveMQ server. This would require no configuration within ActiveMQ as normally you already have a TCP transport connector configured. Usually this is set to listen on port 61616 and so you would just need to allow incoming traffic through the firewall.
 - If the internal network does NOT have public IP addresses, ActiveMQ should still work fine via NAT/Port forwarding if that is available on your firewall/router. Similar to the above, open up a port on the external side of your firewall/router that then forwards TCP traffic through to the internal (private) IP address of your ActiveMQ servers TCP port. Again this would require no extra ActiveMQ configuration as long as the normal TCP transport connector is still configured.

If we are talking proxies here, we are really talking about a Reverse Proxy. Now these are typically used in front of web servers, are you sure that this is really what you are talking about?


A few things to note about ActiveMQ (and probably most JMS providers in general), they never (normally) make an outgoing connections. You said in your previous post, "sends out outgoing messages to remote clients", now this may just be a problem in your wording but I want to make sure that this point is clear... ActiveMQ will never "send out messages" as such. The remote client will make a connection to the server, and then when any message has been placed on a queue that that remote client is consuming from, it will pull the message from the server back to the remote client.

The exception to the above is where you are configuring a "network of brokers" as ActiveMQ calls it. In this scenario, there are more than one broker/server involved and at least one of them "acts" as a client and initiates a connection to another broker/server. This is the only time when a server will initiate a connection and it would only be to another server, not to a client. I assume that this is NOT what you are talking about, so you can just assume the previous paragraphs point, ie. ActiveMQ will never initiate a connection, it only listens for incoming client connections.

Also, another thing that I would like to highlight is that it sounds like you are possibly trying to allow clients that could connect from anywhere on the internet (or at least a possibly large client base that you might not necessarily have control over). While this may be possible, it is not how JMS is *usually* used. Generally the JMS details are internal within a system/application, and if there is any need to interface with apps/system that are external to it, you might do so via a different API, such as SOAP/REST web services, web pages, etc, etc. ActiveMQ's ability to serve messages and manage client connections is generally NOT meant to handle some unknown and uncontrollable number of clients.


I still dont quite understand the proxy connector.  Can I assume it accepts incoming messages from an external proxy into ActiveMQ, and then  sends out outgoing messages to remote clients through potentially the same proxy but possibly to another ultimate destination ?
So, no this is not what the proxy connector is used for. I realise that my last attempt at trying to explain it was not great. It is actually pretty hard to explain because I, myself, can't think of a particularly practical use for it. Maybe this (fairly rough) example might help you understand it better.

Say you have the following snippet of configuration in your activemq.xml...
     <transportConnectors>
      <transportConnector uri="tcp://localhost:6001"/>
     </transportConnectors>
     <proxyConnectors>
      <proxyConnector bind="tcp://localhost:6002" remote="tcp://localhost:6001?useAsyncSend=true&amp;useCompression=true&amp;jms.prefetchPolicy.queuePrefetch=1"/>
    </proxyConnectors>

Open in new window

Now say you had 20 different client processes that need to connect to this broker and all the connections need to use the options like as set in the above configuration (ie. useAsyncSend, etc), you could either have all 20 clients specify those options in their connection URI's or alternatively, just connect to the proxy connector with a URI like...   tcp://mybroker:6002/   and then when each client connects, the proxy connector with forward those connections on to the underlying transport connector at tcp://localhost:6001 but will pass all those preconfigured properties along with it. So all 20 clients can just use a simple URI but still have all those properties set.

(As I said, this still has limited practical use, because I am pretty sure that you can already configure *all* these properties via other means in the activemq.xml. Also, I dodn't see a lot of use in the example that the documentation gives, as you linked to, since the fanout protocol is useful for redundancy but by putting the proxy connector in front of it, you have a single point of failure again! <shrugs> Maybe there is a good use for it, but I don't know!)



I should stop rambling on now! ;)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now