ngageoint / scale

Processing framework for containerized algorithms
http://ngageoint.github.io/scale/
Apache License 2.0
105 stars 45 forks source link

Implement initial message passing capability #838

Closed dfaller closed 7 years ago

dfaller commented 7 years ago

This is the start of Scale's new messaging passing architecture to improve scalability. All of this should be in a Django app, called "messaging"?

Base class CommandMessage

Subclasses register in Django app methods and have no-arg init() Factory method to generate CommandMessage objects from JSON payloads Basic test CommandMessage (log "Hello Scale" or something)

Class CommandMessageManager

Django management command to run cmd_msg_mgr.process_messages()

Classes that abstract/implement backends (SQS, RabbitMQ, Kafka, etc) SQS backend should use long-polling and SQS batch (10 at a time)

Need to updates docs to discuss configuring Scale to use whatever messaging backend.

gisjedi commented 7 years ago

So after some reading on the subject, I'm leaning toward RabbitMQ for the out-of-the-box solution. RabbitMQ appears to be the nearest match for what we are trying to accomplish and has excellent Python (and other cross-language support), as a bonus its usage is very similar to SQS. Kafka isn't a first choice as it is favors an event stream approach with no cleanup following message processing (message roll-off happens by queue size / TTL). It is up to the consumer to manage their position in the log instead of just popping off the front of the queue.

gisjedi commented 7 years ago

The initial implementation will support RabbitMQ, with SQS being the secondary implementation.