activpik/stomp-bundle

Stomp bundle for Symfony 2

Installs: 37

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

Type:symfony-bundle

dev-master 2013-09-07 18:07 UTC

This package is not auto-updated.

Last update: 2024-04-13 12:53:46 UTC


README

Symfony StompClient Integration.

Download this bundle using composer :

In your composer.json add :

"activpik/stomp-bundle": "dev-master" 

In your config.yml file add theses lines

activpik_stomp:
  sandbox: false
  connections:
    kalyzee_messenging :
      host: localhost
      port: 61613
  producers:
      activpik_producer: 
        destination: activpik/producer
        connection: kalyzee_messenging
      activpik_producer2: 
        destination: activpik/producer2
        connection: kalyzee_messenging

You can define a connection to a message broker by adding an connections item. You can define a producer by adding an item to "producers".

Sandbox allows you to test your application without send message.

Usage in a Symfony2 Controller

First you have to create a message :

 $message = $this->container->get("activpik_stomp_message_factory")->createMessage(array("id" => "id", "value"=>"value"));

After you can send it with this command :

$this->container->get("activpik_stomp")->send("activpik_producer", $message);