Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tareqk/integration-test-rabbitmq
https://github.com/tareqk/integration-test-rabbitmq
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tareqk/integration-test-rabbitmq
- Owner: TareqK
- Created: 2020-11-19T20:54:18.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-20T16:20:04.000Z (about 4 years ago)
- Last Synced: 2024-04-23T02:25:40.396Z (8 months ago)
- Language: Java
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# integration-test-rabbitmq
![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.kisoft/integration-test-rabbitmq/badge.png)This Maven plugin allows you to start and stop a RabbitMQ Docker instance as part
of your build. This is especially useful if you want to do integration testing,
instead of mocking rabbitmq## Usage
Add this plugin definition to your pom.xml
```xmlme.kisoft
integration-test-rabbitmq
${LATEST_VERSION_NUMBER}
start-rabbitmq
start-rabbitmq
stop-rabbitmq
stop-rabbitmq
```
## Options
| Option | Description | Default Value |
|--------|----------------------------------|-----------------------|
| port | The port to bind to | 5672 |
| name | The name of the container | Random String |
| image | The RabbitMQ image to use | rabbitmq:3-management |Adding options
```xml
me.kisoft
integration-test-rabbitmq
${LATEST_VERSION_NUMBER}
3321
jon
rabbitmq:3
start-rabbitmq
start-rabbitmq
stop-rabbitmq
stop-rabbitmq
```
This will start RabbitMQ bound on port ```3321```, with the container name ```jon```
and using the image ```rabbitmq:3```### Caveats
1. You need Docker installed on your pc - if you are using windows, im not sure how RabbitMQ docker images work there
2. If a container was was started, but the build crashes for some reason, its not cleaned up, you will
need to cleanup manually
3. You need to always have both the start and stop executions, otherwise the container never stops
4. You can only have one instance/build. This is because of a shared state object