6.0.0
- Dependency has been bumped to PHP 7.1.
- A new
DelayedMessageInterface
has now been added. - Support for FIFO queues has been added.
- If you return any 2xx from your worker middleware (like 204), it will now be transformed as 200 before being returned to Elastic Beanstalk, so that those
messages are also deleted from the queue. Previously, returning a 204 would retry the job. - [BC break] Middlewares are now compatible with latest HTTP middlewares interfaces.
- [BC break] You cannot any longer map multiple middlewares to a single event name. It introduced a lot of complexities to the code and does not map
well to the new approach of middlewares. A better approach now is to use a command bus mechanism to dispatch to multiple handlers. - [BC break]
LocalhostCheckerMiddleware
has been removed. Now, all the security checks are done within theWorkerMiddleware
. Especially, in addition of
the previous security check that enforced the request to come from localhost, we now also check the user agent to verify the request originated from Amazon. - [BC break] Worker route is not added automatically anymore. You will need to manually attach the middleware to the path of your choice.
- [BC break] The structure of messages has been modified. Previously, a message was encoded this way:
{
"name": "message_name",
"payload": {
"id": "123",
"other": "value"
}
}
Now, message body only contain the message content itself:
{
"id": "123",
"other": "value"
}
This allows for simpler messages, and prevent parsing the body to get the message name. The message name is now added through a "message attribute"
called "Name".
When a message is pushed by EC2 instances, the SQSD daemon automatically creates headers with the message attributes. In our case, the daemon automatically
adds a header called X-Aws-Sqsd-Attr-Name
that contains the message name, which is read by the worker to redirect to the proper listeners.
This has two major consequences:
-
Messages created using an older version won't be read by the newer version of the worker. This means that you'll need to deploy both your producer and
consumer applications at the same time to minimize the problems. Once your consumer has been deployed, it may still received some messages coming in the old
format (those created before the deployment). We recommend you to setup a dead letter queue to be able to gracefully retry your messages after. -
Because of the use of SQS attributes, you cannot any longer use this version with old Elastic Beanstalk environments. We therefore recommend you to update
your worker environments to a 2016 IAM or later so that the daemon properly redirects the attributes.