-
Notifications
You must be signed in to change notification settings - Fork 1
Middleware
Server Middleware is called around message invocation/execution. Client Middleware is called around message queueing.
##Using Custom middleware Middleware defined from your application should yield if the message should be pushed into the queue (client) or processed when coming off the queue (server).
MicroQ.configure do |config|
config.middleware.server.add MyServerMiddleware
config.middleware.client.add MyClientMiddleware
end##Default
The default server middleware chain involves Retry, Connections, and Timeout all name-spaced under MicroQ::Middleware::Server::.
###Retry
When a job encounters an error (and raises an exception) the message will be retried with exponential backoff. Something like (i ** 4) + 9.
###Connections
Any latent connections that should be cleared when a message completes or errors. e.g. ActiveRecord
###Timeout Forcefully cause failure/retry when the message invocation takes more than the specified amount of time.
##Available ###Uniqueness (TODO) ###RateLimit (TODO)