RabbitMQ URL?

What is the RabbitMQ URL for CircleCI when we have it listed as a service?
I want to set an environment variable that contains it to read for my tests (product will do this, too).

I could always just mock the connection, but this would be easier.

machine:
    services:
      - postgresql
      - rabbitmq-server

I didn’t find a straight-forward example. I’ll put one up if I can get the standard URL. Thanks!

1 Like

Looks like it’s amqp://localhost:5672

ref: https://github.com/bonusboxme/ElmerFudd/blob/3ac8e6faf5ddebcac7c9329c63b5842f2d669098/test/test_helper.rb

That worked.
I’m surprised there is no environment variable they set to reference.

It would be nice to have:

machine:
  environment:
    AMQP_URL: $RABBITMQ_URL

Or something like that.

Anyway… here is the sample project, as promised:
:build_success: https://github.com/revof11/java-circleci-rabbitmq

2 Likes