Ben Aaron
Ben Aaron

Reputation: 63

Logstash can't connect to my RabbitMQ Broker

I'm trying to connect a Logstash instance, running in a docker container, to an Amazon MQ Broker. My ultimate goal is to insert the MQ message bodies into ElasticSearch

Based on the logs, I think Logstash is able to reach the MQ Queue, but the error message doesn't give any other info:

[2021-05-21T23:30:53,226][ERROR][logstash.inputs.rabbitmq ][instance_journal_pipeline][rmq_instance_source] 
RabbitMQ connection error, will retry. {
  :error_message=>"An unknown error occurred. RabbitMQ gave no hints as to the cause. Maybe this is a configuration error (invalid vhost, for example). I recommend checking the RabbitMQ server logs for clues about this failure.", 
  :exception=>"Java::JavaIo::IOException"
}

My input config is as follows:

input {
   rabbitmq {
     id => "rmq_instance_source"
     ack => true
     durable => true
     passive => true
     exchange => "events"
     exchange_type => "topic"
     host => "${AWS_MQ_URL}"
     user => "${AWS_MQ_USER}"
     port => "${AWS_MQ_PORT}"
     password => "${AWS_MQ_PASSWORD}"
     queue => "outbound_task_queue_name"
     key => "outbound_task_key"
     arguments => {
       # arguments reproduced from the RMQ Queue's admin page
     }
  }
}

Upvotes: 0

Views: 972

Answers (1)

Ben Aaron
Ben Aaron

Reputation: 63

Turns out that this was an SSL configuration issue. The RMQ Logstash plugin requires you to specify that the server is using SSL, and version. The error message does not tell you that this is the case. Verify your SSL version with your MQ Broker.

I added the following params to my config (to match the Amazon MQ configuration) and that solved it:

ssl => true
ssl_version => "TLSv1.2"

Upvotes: 1

Related Questions