A reactor library for consuming from NATS.
- Consumer Client: A generic consuming client.
- Test Consumer: An example of a SpringBoot service using the client. Used for functional tests.
Monitoring: https://natsdashboard.com/jetstream?url=http%3A%2F%2Flocalhost%3A8222
Grafana: http://localhost:3000/dashboards
nats_processor_result
: A counter for the result of a processed message. Has tagresult
that can befailed
orsuccess
.nats_acked
: A counter for number of messages acked.
test_simple_message_is_processed
: Ensures a message is consumed and acked.test_message_that_errors_goes_to_dlq
: A message that continuously errors will go to a DLQ.test_message_that_does_not_ack_in_time_goes_to_dlq
: A message that does not ack in time will eventually go to the DLQ.test_message_when_service_dies_it_is_retried
: When the consumer dies during processing of a message, this message is retried.
- Start NATS locally:
cd deployments/local && make start
- Build the test consumer:
cd nats-reactor-consumer && make docker-build
- Build the tests:
cd functional-tests && make build
- Run the tests:
cd functional-tests && make run
The performance test sends requests to the test consumer and ensures that it processes the expected amount after 5 seconds from the test ending.
- Start NATS locally:
cd deployments/local && make start
- Build the performance test image:
cd performance-tests && make build
- Start the test consumer:
cd nats-reactor-consumer && make docker-run
- Run the test:
cd performance-tests && make run
- NATS consumer properties: https://docs.nats.io/nats-concepts/jetstream/consumers
- NATS examples: https://github.com/synadia-io/rethink_connectivity
- NATS monitoring: https://natsdashboard.com/?url=http%3A%2F%2Flocalhost%3A8222