RabbitMq server setup on Windows - rabbitmq

Recently I tried to use Rabbitmq to try AMQP in our project. For installation I followed the steps mentioned on the offical RabbitMQ site. It created a Rabbitmq.config.example file in appdata. I renamed it to rabbitmq.config file. But even after that in logs I continuously get these messages
=INFO REPORT==== 7-Dec-2015::19:21:14 === accepting AMQP connection <0.377.0> ([::1]:55084 -> [::1]:5672)
=ERROR REPORT==== 7-Dec-2015::19:21:14 === closing AMQP connection <0.377.0> ([::1]:55084 -> [::1]:5672): {bad_header,<<"GET / HT">>}
How to make my server up and running?
When I opened the config file, everything seems to be commented. Should I uncomment any part of it?

I have faced this issue on my ubuntu system.
Try this command:
rabbitmq-plugins enable rabbitmq_shovel rabbitmq_management (with sudo privileges)
and open localhost:15672.

Related

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?

Why can't I find the 'rabbitmq.config' file while I have already installed RabbitMQ?

I'm running Red Hat Enterprise Linux 7.2, I have installed RabbitMQ and systemctl status rabbitmq-server shows
● rabbitmq-server.service - LSB: Enable AMQP service provided by
RabbitMQ broker Loaded: loaded (/etc/rc.d/init.d/rabbitmq-server)
Active: active (running) since Wed 2016-08-17 11:25:56 JST; 1h 14min
ago
Docs: man:systemd-sysv-generator(8)
But when I want to configure it I cannot find the file: find / -iname "rabbitmq.config" shows nothing.
I have an application which connects to 127.0.0.1:3000, but the default port listened by RabbitMQ is 5672, so I want to add the port 3000 (hope it will fix the problem)
RabbitMQ by default does not create the config file.
you have to create it, usually the location is:
/etc/rabbitmq/rabbitmq.config
See: https://www.rabbitmq.com/configure.html
and
https://www.rabbitmq.com/relocate.html
in 2021, 2022 i had to get the rabbitmq config file from their github:
https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbit/docs/rabbitmq.conf.example
i recommend using github to switch to the tag of your rabbitmq installed binaries to ensure the config file is compatible
i would prefer the installer came with the example file but it does not to my knowledge
then once you have the example config file you have to rename it rabbitmq.conf and put it in the correct location (see rabbitmq configuration docs because the directory is different for each distro)

Rabbitmq 3.5.6 cannot set AMQP port

I installed Rabbitmq (v3.5.6) via brew.
I can use command (/usr/local/Cellar/rabbitmq/sbin/rabbitmq-server) to start server,
and I can use http://localhost:15672/ to browse the management page.
I guess I install Rabbitmq successfully.
I want to change the AMQP port to 5673, and I follow the document,
edit /usr/local/etc/rabbitmq/rabbitmq.config as below, but fail.
[
{rabbit, [{tcp_listeners, [5673]}]}
].
The port still is 5673. However, I can use this file to set mqtt port to 11883 (default 1883).
What happens?
Yes, the file should be
/etc/rabbitmq/rabbitmq.conf
I thing that your problem is that you are not rebooting your server/computer.
To apply the changes in your configuration file you have to reboot your server.

heartbeat timeout error running rabbitmq

Running a Rails App in Mac. I start rabbit mq server in other terminal tab:
$ rabbitmq-server
The I do staff within my Web App, and when the mail is supossed to be sent, I got this in /usr/local/var/log/rabbitmq/rabbit#localhost-sasl.log
=INFO REPORT==== 21-Apr-2015::23:02:47 ===
accepting AMQP connection <0.4286.0> (127.0.0.1:57509 -> 127.0.0.1:5672)
=ERROR REPORT==== 21-Apr-2015::23:02:50 ===
closing AMQP connection <0.4286.0> (127.0.0.1:57509 -> 127.0.0.1:5672):
{heartbeat_timeout,running}
Notes:
I left all rabbitmq configuration as default, with this I mean in mailer.rb:
:heartbeat => 10
The same configuration work perfectly in Ubuntu.

RabbitMQ and ActiveMQ running on the same machine

For testing purposes I need ActiveMQ and RabbitMQ running on the same Windows machine. I have both installed, but I can't run them together: I need to stop one service in order to have the other one running.
This is the error I get trying to start RabbitMQ having ActiveMQ running:
=INFO REPORT==== 17-Feb-2015::14:24:00 ===
Error description:
{could_not_start,rabbit,
{bad_return,
{{rabbit,start,[normal,[]]},
{'EXIT',
{rabbit,failure_during_boot,
{boot_step,networking,
{case_clause,
{error,
{{shutdown,
{failed_to_start_child,tcp_listener,
{cannot_listen,{0,0,0,0,0,0,0,0},5672,eacces}}},
{child,undefined,'rabbit_tcp_listener_sup_:::5672',
{tcp_listener_sup,start_link,
[{0,0,0,0,0,0,0,0},
5672,
[inet6,binary,
{packet,raw},
{reuseaddr,true},
{backlog,128},
{nodelay,true},
{linger,{true,0}},
{exit_on_close,false}],
{rabbit_networking,tcp_listener_started,[amqp]},
{rabbit_networking,tcp_listener_stopped,[amqp]},
{rabbit_networking,start_client,[]},
"TCP Listener"]},
transient,infinity,supervisor,
[tcp_listener_sup]}}}}}}}}}}
And this is the error I get trying to start ActiveMQ with RabbitMQ already running:
jvm 1 | INFO | Listening for connections at: tcp://BROKER:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600
jvm 1 | INFO | Connector openwire started
jvm 1 | ERROR | Failed to start Apache ActiveMQ ([localhost, ID:DEV-BROKER01-56290-1424197666199-0:1], java.io.IOException: Transport Connector could not be registered in JMX: java.io.IOException: Failed to bind to server socket: amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600 due to:
java.net.BindException: Address already in use: JVM_Bind)
jvm 1 | INFO | Apache ActiveMQ 5.11.0 (localhost, ID:DEV-BROKER01-56290-1424197666199-0:1) is shutting down
That "Address already in use" is the key I guess.
Any way to sort this out? Thanks
this is the problem:
java.net.BindException: Address already in use: JVM_Bind)
both the brokers use the 5672 port (amqp default port).
just change the port for one broker, for example in rabbitmq check this link:
https://www.rabbitmq.com/configure.html
The configuration file rabbitmq.config allows the RabbitMQ core
application, Erlang services and RabbitMQ plugins to be configured. It
is a standard Erlang configuration file, documented on the Erlang
Config Man Page.
An example configuration file follows:
[
{rabbit, [{tcp_listeners, [5673]}]}
].
This example will the port RabbitMQ listens on from 5672 to 5673.
This configuration file is not the same as rabbitmq-env.conf, which
can be used to set environment variables on non-windows systems.