LanternMQ is a go package that facilitates the messaging infrastructure for the Lantern microservices. LanternMQ provides a simple interface for sending and receiving messages in a queue, and for sending and receiving topic messages.
The package includes a RabbitMQ implementation for the LanternMQ interface.
The package also includes a mock implementation for the LanternMQ interface to support testing.
To test the package, see the testing instructions.
The default users, their password hashes, and each user's permissions can be found in lantern/definitions.json
.
To update users from the RabbitMQ browser interface:
- Log-in as an admin at
localhost:15672
- Go to the Admin tab
- Click the specific user to update
- Near the bottom of the page click Update this User
- Set a new password
A new user can be added by clicking Add a user in the Admin tab.
To update users from the command line:
Run docker exec -it lantern-back-end_lantern-mq_1 rabbitmqctl change_password <username> <new password>
A new user can be added by replacing change_password
in the above line to add_user
.
The definitions.json file must be updated to persist these changes. To update the definitions.json file:
- Get the updated JSON object by using the RabbitMQ API
(e.g.curl -H "Accept:application/json" -u <management_username>:<management_password> "localhost:15672/api/definitions"
) - Replace the current definitions file with the response from Step 1
The two steps can also be combined into one command: curl -H "Accept:application/json" -u <management_username>:<management_password> "localhost:15672/api/definitions" > lanternmq/definitions.json