Connect to RabbitMQ
You need the streamview program, Node.js, and the address of a RabbitMQ server.
streamview does not read the queues of your services. It makes a temporary queue of its own. Thus your services continue to get all their messages. See How streamview reads without taking messages.
Show all exchanges
Section titled “Show all exchanges”Run this command with the address, the user, and the password of your server:
streamview rabbitmq --url amqp://user:password@localhost:5672The first time, the command installs the RabbitMQ adapter. This takes some seconds. The browser then opens. Each routing key on each exchange is one lane.
To find the exchanges, streamview uses the management API of RabbitMQ on port 15672.
It uses the user and the password from --url.
It does not read the exchanges of RabbitMQ itself, which have names that start with amq..
Use a virtual host or TLS
Section titled “Use a virtual host or TLS”Put the virtual host at the end of the address:
streamview rabbitmq --url amqp://user:password@localhost:5672/my-vhostFor a connection with TLS, start the address with amqps://:
streamview rabbitmq --url amqps://user:password@broker.example.com:5671Show only some exchanges
Section titled “Show only some exchanges”Add --exchanges with the names, and a comma between them:
streamview rabbitmq --url amqp://user:password@localhost:5672 --exchanges orders,paymentsConnect if the management API is not available
Section titled “Connect if the management API is not available”If the management API has a different address, give it with --management:
streamview rabbitmq --url amqp://user:password@localhost:5672 --management http://localhost:8080If there is no management API, do these two steps:
- Add
--no-management. - Add
--exchangeswith the names of the exchanges.
For a direct exchange, also add --routing-keys with the routing keys that you want to see.
Without the management API, streamview cannot find them.
streamview rabbitmq --url amqp://user:password@localhost:5672 --no-management \ --exchanges orders,payments --routing-keys charge,refundSee the messages that go directly to a queue
Section titled “See the messages that go directly to a queue”A program can send a message directly to a queue. RabbitMQ calls this the default exchange. streamview cannot connect its queue to the default exchange, thus it does not see these messages.
To see them, use the tracer of RabbitMQ:
- On the RabbitMQ server, run
rabbitmqctl trace_on. - Start streamview with
--trace.
streamview rabbitmq --url amqp://user:password@localhost:5672 --tracestreamview then gets a copy of each message that a program publishes, on all exchanges.
Connect the messages of one order
Section titled “Connect the messages of one order”If your messages are CloudEvents, streamview uses their correlationid field.
If your messages are plain JSON, streamview uses the correlation_id property of the message.
If your programs do not set this property, add --correlation-field with the name of the field that all messages of one order contain.
streamview rabbitmq --url amqp://user:password@localhost:5672 --correlation-field orderIdDecrease the number of lanes
Section titled “Decrease the number of lanes”Each routing key becomes one lane. If your routing keys contain IDs or regions, there are too many lanes.
Use --depth to make a lane from only the first parts of the routing key.
streamview rabbitmq --url amqp://user:password@localhost:5672 --depth 2With --depth 2, order.created.eu and order.created.us are one lane.