Create a new file in /worker and have it export a function.
This function should have the following signature: function(event, cb)event is the message the the queue processor receives.
cb is a function to call when the worker is done processing the message.
The exported function must be added to the worker list in processor.js in order for it to receive messages.
Messages
Each message will have an event_type attribute that a worker can check to determine if it should process the message
any further. Data about the event is available on event.data.
Sending test events
install awscli (pip install awscli)
awscli configure - add your AWS keys
aws sqs send-message –queue-url –message-body
Messages are typically sent using hatchet, which sends messages with the following
JSON structure, which you can provide as a string value when testing with the above method.
Sawmill
A Queue Message Processor written in NodeJS. Sawmill processes messages generated by these projects:
Installation
npm installcp env.dist .envnpm startnpm run webCreating a Worker
Create a new file in
/workerand have it export a function. This function should have the following signature:function(event, cb)eventis the message the the queue processor receives.cbis a function to call when the worker is done processing the message. The exported function must be added to the worker list inprocessor.jsin order for it to receive messages.Messages
Each message will have an
event_typeattribute that a worker can check to determine if it should process the message any further. Data about the event is available onevent.data.Sending test events
pip install awscli)awscli configure- add your AWS keysMessages are typically sent using hatchet, which sends messages with the following JSON structure, which you can provide as a string value when testing with the above method.