Skip to content

Conversation

@ThomasMatlak
Copy link

Clean up log output on a ConnectionException when initializing a broker connection.

Remove stack trace from log.
Add message that initializing the connection will be retried.

When spinning up ONgDB and RabbitMQ together through Docker, ONgDB can get to broker connection initialization before RMQ is ready.
This puts a number of ERROR messages in the ONgDB log as it tries to establish the connection.

Sample error message:

ERROR [BrokerConnectionInitializationException] Failed to initialize RabbitMQ connection 'rabbitmq'. Connection refused (Connection refused)
java.net.ConnectException: Connection refused (Connection refused)
    at java.net.PlainSocketImpl.socketConnect(Native Method)

Proposed Changes

  • during broker initialization, use a WARN log message when unable to establish the connection
  • remove stack traces from broker connection error log output

Sample of the new broker log messages (not just the errors):

INFO  APOC Broker: Adding RabbitMQ Connection 'rabbitmq' with configurations {vhost=/, password=guest, port=5672, host=rabbitmq, type=RABBITMQ, enabled=true, username=guest}
WARN  [BrokerConnectionInitializationException] Failed to initialize RabbitMQ connection 'rabbitmq'. java.net.ConnectException: Connection refused (Connection refused)
WARN  APOC Broker: Initializing RabbitMQ connection 'rabbitmq' will be retried.
ERROR [BrokerRuntimeException] RabbitMQ connection 'rabbitmq' failed healthcheck.
ERROR [BrokerRuntimeException] RabbitMQ connection 'rabbitmq' failed healthcheck.
INFO  APOC Broker: Connection 'rabbitmq' reconnected.

…oker connection

Remove stack trace from log.
Add message that initializing the connection will be retried.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant