1 | <?php |
||
15 | class Driver implements DriverInterface, ContainerAwareInterface |
||
16 | { |
||
17 | use ContainerAwareTrait; |
||
18 | use QueueManagerAwareTrait; |
||
19 | |||
20 | protected $debug; |
||
21 | protected $connections; |
||
22 | |||
23 | /** |
||
24 | * @param string $queueName |
||
25 | * @return \Kaliop\QueueingBundle\Queue\ProducerInterface |
||
26 | */ |
||
27 | public function getProducer($queueName) |
||
31 | |||
32 | /** |
||
33 | * @param string $queueName |
||
34 | * @return object |
||
35 | */ |
||
36 | public function getConsumer($queueName) |
||
40 | |||
41 | public function acceptMessage($message) |
||
45 | |||
46 | /** |
||
47 | * Unlike the RabbitMQ driver, we do not have to deal with a native message type from the underlying library. |
||
48 | * So we just let the Producer create messages of the good type, and decoding them becomes a no-op |
||
49 | * |
||
50 | * @param \Kaliop\Queueing\Plugins\StompBundle\Adapter\Stomp\Message $message |
||
51 | * @return \Kaliop\Queueing\Plugins\StompBundle\Adapter\Stomp\Message |
||
52 | */ |
||
53 | public function decodeMessage($message) |
||
57 | |||
58 | /** |
||
59 | * @param string $queueName |
||
60 | * @return \Kaliop\QueueingBundle\Queue\QueueManagerInterface |
||
61 | */ |
||
62 | public function getQueueManager($queueName) |
||
68 | |||
69 | public function setDebug($debug) |
||
75 | |||
76 | /** |
||
77 | * @param string $connectionId |
||
78 | * @param array $params |
||
79 | */ |
||
80 | public function registerConnection($connectionId, array $params) |
||
84 | |||
85 | protected function getConnectionConfig($connectionId) |
||
93 | |||
94 | /** |
||
95 | * Dynamically creates a producer, with no need for configuration except for the connection configuration |
||
96 | * |
||
97 | * @param string $queueName the name to be used later when asking the producer to the driver |
||
98 | * @param string $queueDestination the stomp destination |
||
99 | * @param string $connectionId the name of a stomp connection as set in configuration |
||
100 | * @return Producer |
||
101 | */ |
||
102 | public function createProducer($queueName, $queueDestination, $connectionId) |
||
110 | |||
111 | /** |
||
112 | * Dynamically creates a consumer, with no need for configuration except for the connection configuration |
||
113 | * |
||
114 | * @param string $queueName the name to be used later when asking the producer to the driver |
||
115 | * @param string $queueDestination the stomp destination |
||
116 | * @param string $connectionId the name of a stomp connection as set in configuration |
||
117 | * @param string $subscriptionName the name of the subscription to be used to connect to the broker |
||
118 | * @param MessageConsumerInterface $callback |
||
119 | * @param string $routingKey |
||
120 | * @return Consumer |
||
121 | */ |
||
122 | public function createConsumer($queueName, $queueDestination, $connectionId, $subscriptionName, $callback=null, $routingKey=null) |
||
133 | } |
||
134 |