library queueingbundle-sqs
Kaliop Queueing Bundle - AMAZON SQS plugin
kaliop/queueingbundle-sqs
Kaliop Queueing Bundle - AMAZON SQS plugin
- Saturday, September 10, 2016
- by gggeek
- Repository
- 3 Watchers
- 1 Stars
- 1,718 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 6 Versions
- 3 % Grown
Kaliop Queueing Bundle - AMAZON SQS plugin
Adds support for AWS Simple Queueing Service to the Kaliop Queueing Bundle, (*1)
See: http://aws.amazon.com/sqs/ and https://github.com/kaliop-uk/kueueingbundle respectively., (*2)
It has been given its own bundle because it has higher requirements than the base Queueing Bundle, (*3)
Installation
-
Install the bundle via Composer., (*4)
-
Enable the KaliopQueueingPluginsSQSBundle bundle in your kernel class registerBundles()., (*5)
-
Clear all caches if not on a dev environment, (*6)
Usage
-
If you do not have an AWS account, sign up for one at http://aws.amazon.com/, (*7)
-
Create an SQS queue, using the web interface: https://console.aws.amazon.com/sqs/home, (*8)
-
Set up configuration according to your AWS account, (*9)
- edit parameters.yml in this bundle
-
check that you can list the queue:, (*10)
php app/console kaliop_queueing:managequeue list -isqs
php app/console kaliop_queueing:managequeue info -isqs <queue>
-
push a message to the queue, (*11)
php app/console kaliop_queueing:queuemessage -isqs <queue> <jsonpayload>
-
receive messages from the queue, (*12)
php app/console kaliop_queueing:consumer -isqs <queue>
Running tests
If you want to run the test suite outside of Travis, you will need to, (*13)
-
have an AWS SQS account, (*14)
-
set the following environment variables: SYMFONY__SQS__KEY SYMFONY__SQS__SECRET (note that the test config at
the moment hardcodes usage of the us-east-1 region), (*15)
-
check out somewhere this bundle (no need to install the full Symfony stack), (*16)
-
run composer install, (*17)
-
run php vendor/phpunit/phpunit/phpunit Tests/phpunit, (*18)
Notes
-
SQS does not natively support routing-keys the way that RabbitMQ does, nor the exchange/queue topology split.
This bundle does add back support for routing-keys, but it is far from ideal; you are encouraged to set up
multiple queues instead of using a single queue with multiple consumers which only consumed messages based on
routing keys, esp. if you transmit massive amounts of messages in parallel., (*19)
The way the bundle supports routing keys is:, (*20)
- if the Producer has a routing key set, it will add it to the Message Attributes when sending a Message
- every Consumer always asks for all messages available in the Queue
- if the Consumer has a routing key set, and the the message has one in its Message Attributes, the two are matched
- in case of a match, standard processing goes on: the Consumer sends an ACK call to SQS to signal message reception
- in case of no match, the Consumer does not send the ACK request to SQS; SQS will then wait for a little while, then
put the message back in the queue (the amount of time it waits can be configured per-queue)
If you find any discrepancy between the way routing keys are matched by RabbitMQ and by this bundle, please report
it as a bug., (*21)
-
SQS does not support setting a per-message TTL, only a per-queue one, so all MessageProducers which do have a TTL
parameter in their public methods will just ignore it when being used with the SQS driver, (*22)
-
SQS does not guarantee that messages are delivered in the same order they are sent, unless you use FIFO queues.
To use a FIFO queue:
- create the FIFO queue
- in the bundle configuration, set a value for the message_group_id setting for your queue
- if you use custom unique message IDs, you will have to set up a service implementing the MessageDeduplicationIdCalculatorInterface
interface, and hook it up it using the message_deduplication_id_calculator setting for your queue, (*23)
-
SQS does guarantee that messages are delivered, but it does not guarantee that every message is delivered only once.
If such a constraint is important, build unique message IDs in your app and manage them - or use FIFO queues., (*24)
-
For a more in-depth comparison of SQS and RabbitMQ, see f.e. http://blog.turret.io/rabbitmq-vs-amazon-sqs-a-short-comparison/, (*25)
, (*26)
, (*27)
dev-master
9999999-dev
Kaliop Queueing Bundle - AMAZON SQS plugin
Sources
Download
GPL-2.0
The Requires
The Development Requires
v0.5.0
0.5.0.0
Kaliop Queueing Bundle - AMAZON SQS plugin
Sources
Download
GPL-2.0
The Requires
The Development Requires
v0.4.0
0.4.0.0
Kaliop Queueing Bundle - AMAZON SQS plugin
Sources
Download
GPL-2.0
The Requires
The Development Requires
v0.3.0
0.3.0.0
Kaliop Queueing Bundle - AMAZON SQS plugin
Sources
Download
GPL-2.0
The Requires
The Development Requires
v0.2.1
0.2.1.0
Kaliop Queueing Bundle - AMAZON SQS plugin
Sources
Download
GPL-2.0
The Requires
The Development Requires
v0.2.0
0.2.0.0
Kaliop Queueing Bundle - AMAZON SQS plugin
Sources
Download
GPL-2.0
The Requires
The Development Requires