This service allows a stackable queue consumer framework. Requirements: Scala, Play, RabbitMQ, Mongo
The components are
- REST API (To allow messages to be written to the system)
- A configurable number of queues (To act as part of consumer stack)
- An actor system for message producers (To ensure high performance in a scalable and predicatble manner)
- Actor systems for message consumers (To ensure high performance in a scalable and predicatble manner)
- Mongo as the backend datastore (To save the messages and processed data)
Config driven queue system
- The primary exchange name
- Number of actors in the actor system for the producers
- Queue consumers. You can add as many queue consumers as you want. For each consumer, configurable parameters are
- Queue name
- Incoming routing key for the queue
- Sorting order (order in which to put this consumer in the consumer stack)
- Consumer class name
- Number of actors in the actor system for this consumer
- RabbitMQ settings
- Mongo settings
A user can call the REST API to put a message in the system. The system will put the message on the first queue defined in the config. The consumer attached to that queue will consume the message, process it, save it to the database and push a new message back to the exchange with a new routing key. This new routing key is automatically configured so that the next queue in the stack will get the message. Then the consumer attached to that queue will consumer the message and the cycle will carry on till the last consumer.
The logic for the first and last consumer is already provided in the framework. They save and update the message in Mongo.