Sending a message in ActiveMQ over the Internet

I want to implement messaging over the Internet. But there was no IP Public yet. So I want to ask anyone here about sending a message to ActiveMQ using JMS over the Internet?

Could this be done?

+4
source share
3 answers

Yes, it provides a regular TCP-based endpoint (by default on port 61616). However, this will not be the recommended deployment model β€” the best model would be to set the http-based endpoint using a servlet container that internally passes the message to the active broker.

There are many good solutions that can do this -

+3
source

Yes, it can be done. we currently operate just below the thousands of β€œconsumers” who connect to our brokers over the Internet.

As for the insecurity of traffic over the Internet, I do not completely agree:

disclosing a web service is as risky as viewing a broker. In the end, you are never 100% sure that your own code or code or the underlying application (Apache CXF, Webserver, application server, database server, message broker) contains flaws that can pose a security risk. Secondly, HTTP is just like TCP traffic as is ActiveMQ (Stomp or openwire protocol)

Thus, you can take all measures to minimize the risk.

we did the following:

  • User and password required to connect to the broker (ActiveMQ supports a wide range of authentication solutions, and you can download them yourself)

  • Switch the port to a different number, so discovery is harder

  • if you have control over consumers, use IP filters in the firewall so that ip can connect to the broker (unfortunately, in our case this was not possible)

  • encrypt your messages

  • We have added application level authentication using a token. Thus, each message is authenticated in our own application.

-> if all of them are implemented, I think that you are quite safe and as a bonus you do not need an additional level of web services (if this application needs to be scaled, you will need to scale your web services equally using brokers.

+2
source

Normal connections (openwire) must be accurate. It’s much easier to stick with a standard setup than trying to set up web services and more. Just make sure you encrypt the channels with SSL . If you use simple passwords, they can be found on public networks (unlikely, but anyway) - that’s why I prefer SSL.

In fact, ActiveMQ is a very good way to communicate over the Internet, as it supports transactions and persistence, which allows it to deal with network stability issues.

However, for this you need a public IP address (or some kind of solution for NAT / port forwarding with an open IP address) on the computer running the ActiveMQ server.

+1
source

Source: https://habr.com/ru/post/1340112/


All Articles