"Socket error on client..., disconnecting" when Mosquitto brigde to RabbitMQ - rabbitmq

I have installed two broker of Mosquitto (1.4.2-3.2x86_64)and RabbitMQ (3.5.3-1) using newest version so far on CentOS 6 servers. With default configuration i can sub/pub messages for each broker separately, this mean that MQTT is running normally.
But when i bridge Mosquitto server to a RabbitMQ server, i face below problem right after i change mosquitto.conf file:
"Connecting bridge (Rabbit-IP)
Socket error on client client_name, disconnecting".
My bridge configuration in mosquitto.conf is:
connection test
address Rabbitmq-IP
topic # both 0 local/ remote/
Can you explain to me !
Thanks !

Try to use this option in your config file for the bridge
try_private false
This is an option that will tell the other broker that this is a bridge connection and defaults to true and if the RabbitMQ doesn't supports it, then it would not allow you to connect.

Related

How to setup RabbitMQ Dynamic Shovel in SSL

I want to setup a Shovel in which the destination RabbitMQ is configured to be TLS enabled.
I am unable to create a Shovel and the shovel stays in a starting state.
I have two different RabbitMQ instance in two separate docker container, one of them exposed via port 5671 (SSL) and 6671 (SSL) from host machine.
I am using RabbitMQ management plugin to establish the shovel
Below are the connection details
Source AMQP URI:
amqp://admin:pass#localhost:5672 (non-SSL)
Target AMQP URI
amqps://localhost:6671?cacertfile=/data/shared-file/certificates/ca_certificate.pem&certfile=/data/shared-file/certificates/client_certificate.pem&keyfile=/data/shared-file/certificates/client_key.pem&verify=verify_peer&server_name_indication=MyTestCA
What could be the problem here?
Kindly help

How to recieve a Broker's data with an MQTT.fx client?

I have both a client and a broker running on a remote Linux machine within a Lora Network server that has a mosquitto connector.
The client can listen for the broker's broadcast from a certain address and port (#127.0.0.1:1883)
I would like to open an ssh tunnel between this remote machine and my machine (windows 10) to 'eavesdrop' on the communication between the client and the broker using MQTT.fx to run a mosquitto client;
So far I tried to:
Run ssh -L 22883:#remoteMachineAdress:1883 usern.ame#gatewayAdress -p222 on MobaXtrem](https://mobaxterm.mobatek.net/)
Then I launch a client on MQTT.fx to listen on the broker: 127.0.0.1 port 22883.
This establishes a connection to the broker. However, I am not receiving any of the messages passed to the original client (the one on the remote machine) receives.
Can anyone tell me what am I doing wrong?
And if there are any tutorials about this?
I appreciate all the help I can get, thank you in advance!
This configuration is correct, it was the connector on the server who was sending the data to a different application.

Apache Active MQ connect exception using Java program from remote machine

I was trying to run Apache Activemq , broker ran successfully at localhost. At same machine JMS producer , consumer Java applications ran successfully . BUT I changed Uri to tcp://192.168.1.1:61616 in activemq.xml and ran the broker in machine 1( 192.168.1.1) . I ran consumer in machine 1. I ran producer from machine 2 in LAN. But producer caused jms exception. ConnectException. Connection refused. As a result producer and consumer can not communicate in LAN . Please guide.
If I understand this correctly you have this setup:
Machine1: ActiveMQ Broker and Consumer
Machine2: Producer
Then you need to setup your configurations like this:
ActiveMQ Broker: in activemq.xml set to tcp://192.168.1.1:61616
Consumer: tcp://192.168.1.1:61616
Producer: tcp://192.168.1.1:61616
Thank you very much. It was firewall that was preventing connection. I disabled firewall, things is running fine. Regards.

Why does NodeJS client continuously keep on disconnecting to RabbitMQ broker?

I have installed RabbitMQ broker on Windows Server 2016. I have to connect to it using NodeJS client but it continuously disconnects and again connect to the broker. Can you please suggest what might have gone wrong ? I have gone through many articles but nothing solved my issue.
In order to achieve this,I have mentioned tcp keep-alive in rabbitmq.config file but it didn't solve my issue.
My configuration file looks like following :
rabbitmq.config (Location : C:\Users\\AppData\Roaming\RabbitMQ)
mqtt.listeners.tcp.default = 1883
## Default MQTT with TLS port is 8883
# mqtt.listeners.ssl.default = 8883
# anonymous connections, if allowed, will use the default
# credentials specified here
mqtt.allow_anonymous = true
mqtt.default_user = test
mqtt.default_pass = test
mqtt.vhost = dev
mqtt.exchange = amq.topic
# 24 hours by default
mqtt.subscription_ttl = 86400000
mqtt.prefetch = 10
net.ipv4.tcp_keepalive_time=60
net.ipv4.tcp_keepalive_intvl=20
net.ipv4.tcp_keepalive_probes=3
handshake_timeout = 60000
Ideally client should connect to the broker only once and keep on listening on a port from that broker. It should never disconnect in between.
After making some changes in config file I always stop rabbitmq and again starts by using following commands from sbin directory of RabbitMQ :
rabbitmq-service.bat stop
rabbitmq-service.bat install
rabbitmq-service.bat start
When I hit 2nd command, I get error that the configuration file should be in Erlang format with '.conf' extension. I did that as well but I faced same issue again.
Is there anything missing in configuration ? Please suggest.
I found that clients are sensitive, if you try to acknowlage the same message twice, for example, they will disconnect. Are you doing anything at all after you connect to the broker? Setting up queues that already exist with different params, declaring exchanges?

Using the mosquitto broker installed in google cloud 's instance

I have installed mosquitto broker in a Ubuntu VM Instance of Google Cloud . I can also see the broker running on port 1883 of the VM . The external IP of the VM is 130.211.173.165 . Now when i try to create a client for this broker by the command
client.connect_async("130.211.173.165",1883,60)
I get an error message saying that the connection was actively refused by the remote IP .
I have also added a network firewall rule stating the below but nothing seems to work.
Source Ranges:
0.0.0.0/0
Allowed Protocols or Ports:
tcp:1883
Can someone help here ?