Kaliop Queueing Bundle - Stomp plugin
Adds support for the STOMP protocol to the Kaliop Queueing Bundle
STOMP is a protocol used by multiple messaging brokers, such as ActiveMQ, Apache Apollo and RabbitMQ (but we suggest you use AMQP to communicate with RabbitMQ, which is supported natively by the Queueing Bundle)
Currently the bundle is tested using Apache Apollo and Apache ActiveMQ.
Install the bundle via Composer.
Enable the KaliopQueueingPluginsStompBundle bundle in your kernel class registerBundles().
Clear all caches if not on a dev environment
Start the messaging broker of your choice
Create a queue, using the appropriate management console:
Apollo: : no need, queues and topics are created based on need
ActiveMQ: no need, queues and topics are created based on need
Set up configuration according to your broker
- copy queueingbundle_stomp_sample.yml in this bundle to your app/config folder, make sure you require it, and edit it
check that you can list the queue:
php app/console kaliop_queueing:managequeue list-configured -istomp
not yet supported: ask the broker for queue info
php app/console kaliop_queueing:managequeue info -istomp <queue>
push a message to the queue
php app/console kaliop_queueing:queuemessage -istomp <queue> <jsonpayload>
receive messages from the queue
php app/console kaliop_queueing:consumer -istomp <queue>
Stomp does not natively support routing-keys the way that RabbitMQ does. Also, the implementation of Topic and Queue messaging patterns is left to the single brokers.
This bundle does add back support for routing-keys. It also strives to replicate the same messaging pattern regardless of the broker in use. The way to achieve that differs with each broker.
- for Apollo, topics with persistent subscriptions are used
- for ActiveMQ, 'Virtual Topics' are used ( http://activemq.apache.org/virtual-destinations.html )
- NB: ActiveMQ 5.5 seems to have a bug with wildcard support when using '#' as key. If this is a problem for you, please upgrade to a later version
In the bundle configuration, the same wildcard characters are to be used regardless of teh broker in use: # and *