Connect to AMPQ RabbitMQ on port 5671 - rabbitmq

I am trying to connect to a RabbitMQ remote machine to read queue messages and currently I am using port 5672 which is sending the auth message over plain text so I need to get it working on port 5671 but it's failing.
Does it require anymore configuration then just changing the port number below?
I am using the nodeJS plugin for ampq-callback to connect
amqp.connect('amqp://xxx:5671', function(err,conn) {

https://www.rabbitmq.com/ssl.html
https://www.rabbitmq.com/troubleshooting-ssl.html
Yes, you must set up TLS in RabbitMQ.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

Related

RabbitMQ: None of the specified endpoints were reachable?

Trying to publish a message to RabbitMQ using Masstransit but its failing.
I've looked at a few SO posts on this but none have a concrete answer. I've tried different ways of formatting the connection string, hard coding, etc but nothing seems to work.
If I connect outside of the app just via the browser, everything works fine.
In my app though, it just can't connect?
[09:09:46 WRN] Connection Failed: rabbitmq://{host}:15672/
RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable
---> System.IO.IOException: connection.start was never received, likely due to a network timeout
I'm registering it like:
serviceCollection.AddMassTransit(x =>
{
x.UsingRabbitMq((rabbitContext, rabbitConfig) =>
{
rabbitConfig.Host(new Uri("amqps://{host}:15672/"), h =>
{
h.Username("admin");
h.Password("...");
});
rabbitConfig.ConfigureEndpoints(rabbitContext);
rabbitConfig.Durable = true;
});
});
If I just use the RabbitMQ library it also connects fine, so Masstransit seems to be the issue here?
/var/log/rabbitmq/rabbit#mg.log only logs failed connections via the management panel it seems, at least its not logging for failed app connects.
Check that you are using the right network port. Port 15672 is the default port for the web-based management console, which is not the same port MassTransit needs to connect to. That defaults to 5672 for plain AMQP, and 5671 for TLS-secured AMQP.
To confirm which ports your RabbitMQ server is listening on, and that your web server can access them see this troubleshooting guide and the answers to this question.

How to configure a connection to the multiple RabbitMQ nodes?

I can configure the RabbitMQ client connection in two ways:
comma-separated list of IP addresses
host name that is DNS A record with multiple IP addresses
Will RabbitMQ Client connect to another node when the one with which is connected will fail?
Will do it in both cases?
Yes, it should work as described. Give it a try yourself! I suggest using toxiproxy to interrupt a connection and force a reconnect to another node.
NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

Apache NiFi TCP Client/Server

Can I simulate a TCP client/server interaction using Apache NiFi processors alone or do I have to write code for this? The processors to be considered here are ListenTCP, PutTCP, and GetTCP. In particular, I want to simulate and show a POC for sending HL7 messages from a TCP client to a TCP server. Anyone done this before using NiFi? Any help would be appreciated. Thanks.
ListenTCP starts a server socket waiting for incoming TCP connections. Your client can make connections to the hostname where NiFi is running and the port specified in ListenTCP. If your client needs to send multiple pieces of data over a single connection, then it must send new-lines in between each message. You can simulate a client in NiFi by using PutTCP and pointing it at the same host/port where ListenTCP is running.
UPDATE - Here is an example of the flow:

ActiveMQ embedded with MQTT and Default MQ enabled, Possible to publish to both in one call?

I am using ActiveMQ embedded in Glassfish with both the default 61616 communication port and a port with MQTT enabled.
Is there a way to publish to both of these MQs in one call if ActiveMQ is configured a certain way?
If not, is the only way to connect to the MQTT server from the J2EE server through a 3rd party MQTT client?
If so, is there a MQTT lib that can take advantage of J2EE container's connection pools?
All protocols in ActiveMQ will share the same topics and queues.
You can subscribe and publish as you wish from java/JMS and the data will be accessible on the same topic using MQTT.
Of course, there will be some issues if you use JMS-only features, such as ObjectMessage and whatnot, but that is pretty obvious. Stick to text messages on topics and you should be fine.

find where activemq is running

I am starting to study ActiveMQ, and there is one question that I must have the answer as soon as possible: is it possible for a, say, console program, to know the IP of the machine where ActiveMQ is running without any previous information, like configuration file, or a parameter passed to the program? I wonder if ActiveMQ answers to some type of broadcast network message, reporting the IP of the computer it is running.
Thanks!
While your question is a bit vague on actual requirements and network capabilities etc, the most reasonable answer to this is to use discovery via multicast to locate a broker to connect to. There is documentation for this here, here, here and some here and more if you bother to search Google.
When you enable discovery on the broker's transport connector it will broadcast via multicast the IP address and port where a client can connect. You should do some research and even browse the ActiveMQ code to see how this works.
No, that's not possible. If all of the world's ActiveMQ servers were broadcasting their connection info to every producer or consumer in the world, that would be a ton of traffic. And if they were, how's a producer of consumer supposed to know which one to connect to, without being told? You have to tell the client how to reach the broker, and it's not a big deal to do.