https://github.com/davesag/competing-services-example
A simple example of how to use the amqp-simple-pub-sub library to implement competing micro-services.
https://github.com/davesag/competing-services-example
amqp competing-services example microservices
Last synced: 6 months ago
JSON representation
A simple example of how to use the amqp-simple-pub-sub library to implement competing micro-services.
- Host: GitHub
- URL: https://github.com/davesag/competing-services-example
- Owner: davesag
- License: mit
- Created: 2018-06-04T08:18:54.000Z (over 7 years ago)
- Default Branch: develop
- Last Pushed: 2024-04-29T07:36:30.000Z (over 1 year ago)
- Last Synced: 2024-05-02T00:12:10.990Z (over 1 year ago)
- Topics: amqp, competing-services, example, microservices
- Language: JavaScript
- Homepage: https://itnext.io/connecting-competing-microservices-using-rabbitmq-28e5269861b6
- Size: 3.12 MB
- Stars: 19
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# competing-services-example
An example of how to use the [`amqp-simple-pub-sub`](https://github.com/davesag/amqp-simple-pub-sub) library to implement competing micro-services.
## See Also
- [itnext.io/connecting-competing-microservices-using-rabbitmq](https://itnext.io/connecting-competing-microservices-using-rabbitmq-28e5269861b6)
- [`amqp-simple-pub-sub`](https://github.com/davesag/amqp-simple-pub-sub)
- [`amqp-delegate`](https://github.com/davesag/amqp-delegate)
## To Run
1. Ensure you have [Docker](https://www.docker.com) installed.
2. Clone this repo to your local machine, then,
3. From within the project folder:
```sh
docker-compose up -d
```
4. Wait a few seconds for RabbitMQ to start, then:
```sh
npm start
```
5. You can `crtl-c` when you get tired of watching it.
## Development
### Branches
| Branch | Status | Coverage | Audit | Notes |
| ------ | ------ | -------- | ----- | ----- |
| `develop` | [](https://circleci.com/gh/davesag/competing-services-example/tree/develop) | [](https://codecov.io/gh/davesag/competing-services-example) | [](https://snyk.io/test/github/davesag/competing-services-example/develop) | Work in progress |
| `main` | [](https://circleci.com/gh/davesag/competing-services-example/tree/main) | [](https://codecov.io/gh/davesag/competing-services-example) | [](https://snyk.io/test/github/davesag/competing-services-example/main) | Latest release |
### Prerequisites
- [NodeJS](https://nodejs.org), 8.10.0+ (I use [`nvm`](https://github.com/creationix/nvm) to manage Node versions — `brew install nvm`.)
- [Docker](https://www.docker.com) (Use [Docker for Mac](https://docs.docker.com/docker-for-mac/), not the homebrew version)
### Initialisation
```sh
npm install
```
### To Start the queue server for integration testing
```sh
docker-compose up -d
```
Runs Rabbit MQ.
Run `docker-compose down` to stop it.
### Test it
- `npm test` — runs the unit tests (quick and does not need `rabbitmq` running)
### Lint it
```sh
npm run lint
```
## Contributing
Please see the [contributing notes](CONTRIBUTING.md).