@@ -120,18 +120,18 @@ public function createConsumer(PsrDestination $destination)
120
120
$ queue = $ this ->createTemporaryQueue ();
121
121
$ this ->bind (new AmqpBind ($ destination , $ queue , $ queue ->getQueueName ()));
122
122
123
- return new AmqpConsumer ($ this ->getChannel (), $ queue , $ this ->buffer , $ this ->config ['receive_method ' ]);
123
+ return new AmqpConsumer ($ this ->getLibChannel (), $ queue , $ this ->buffer , $ this ->config ['receive_method ' ]);
124
124
}
125
125
126
- return new AmqpConsumer ($ this ->getChannel (), $ destination , $ this ->buffer , $ this ->config ['receive_method ' ]);
126
+ return new AmqpConsumer ($ this ->getLibChannel (), $ destination , $ this ->buffer , $ this ->config ['receive_method ' ]);
127
127
}
128
128
129
129
/**
130
130
* @return AmqpProducer
131
131
*/
132
132
public function createProducer ()
133
133
{
134
- $ producer = new AmqpProducer ($ this ->getChannel (), $ this );
134
+ $ producer = new AmqpProducer ($ this ->getLibChannel (), $ this );
135
135
$ producer ->setDelayStrategy ($ this ->delayStrategy );
136
136
137
137
return $ producer ;
@@ -142,7 +142,7 @@ public function createProducer()
142
142
*/
143
143
public function createTemporaryQueue ()
144
144
{
145
- list ($ name ) = $ this ->getChannel ()->queue_declare ('' , false , false , true , false );
145
+ list ($ name ) = $ this ->getLibChannel ()->queue_declare ('' , false , false , true , false );
146
146
147
147
$ queue = $ this ->createQueue ($ name );
148
148
$ queue ->addFlag (InteropAmqpQueue::FLAG_EXCLUSIVE );
@@ -155,7 +155,7 @@ public function createTemporaryQueue()
155
155
*/
156
156
public function declareTopic (InteropAmqpTopic $ topic )
157
157
{
158
- $ this ->getChannel ()->exchange_declare (
158
+ $ this ->getLibChannel ()->exchange_declare (
159
159
$ topic ->getTopicName (),
160
160
$ topic ->getType (),
161
161
(bool ) ($ topic ->getFlags () & InteropAmqpTopic::FLAG_PASSIVE ),
@@ -172,7 +172,7 @@ public function declareTopic(InteropAmqpTopic $topic)
172
172
*/
173
173
public function deleteTopic (InteropAmqpTopic $ topic )
174
174
{
175
- $ this ->getChannel ()->exchange_delete (
175
+ $ this ->getLibChannel ()->exchange_delete (
176
176
$ topic ->getTopicName (),
177
177
(bool ) ($ topic ->getFlags () & InteropAmqpTopic::FLAG_IFUNUSED ),
178
178
(bool ) ($ topic ->getFlags () & InteropAmqpTopic::FLAG_NOWAIT )
@@ -184,7 +184,7 @@ public function deleteTopic(InteropAmqpTopic $topic)
184
184
*/
185
185
public function declareQueue (InteropAmqpQueue $ queue )
186
186
{
187
- list (, $ messageCount ) = $ this ->getChannel ()->queue_declare (
187
+ list (, $ messageCount ) = $ this ->getLibChannel ()->queue_declare (
188
188
$ queue ->getQueueName (),
189
189
(bool ) ($ queue ->getFlags () & InteropAmqpQueue::FLAG_PASSIVE ),
190
190
(bool ) ($ queue ->getFlags () & InteropAmqpQueue::FLAG_DURABLE ),
@@ -202,7 +202,7 @@ public function declareQueue(InteropAmqpQueue $queue)
202
202
*/
203
203
public function deleteQueue (InteropAmqpQueue $ queue )
204
204
{
205
- $ this ->getChannel ()->queue_delete (
205
+ $ this ->getLibChannel ()->queue_delete (
206
206
$ queue ->getQueueName (),
207
207
(bool ) ($ queue ->getFlags () & InteropAmqpQueue::FLAG_IFUNUSED ),
208
208
(bool ) ($ queue ->getFlags () & InteropAmqpQueue::FLAG_IFEMPTY ),
@@ -215,7 +215,7 @@ public function deleteQueue(InteropAmqpQueue $queue)
215
215
*/
216
216
public function purgeQueue (InteropAmqpQueue $ queue )
217
217
{
218
- $ this ->getChannel ()->queue_purge (
218
+ $ this ->getLibChannel ()->queue_purge (
219
219
$ queue ->getQueueName (),
220
220
(bool ) ($ queue ->getFlags () & InteropAmqpQueue::FLAG_NOWAIT )
221
221
);
@@ -232,7 +232,7 @@ public function bind(InteropAmqpBind $bind)
232
232
233
233
// bind exchange to exchange
234
234
if ($ bind ->getSource () instanceof InteropAmqpTopic && $ bind ->getTarget () instanceof InteropAmqpTopic) {
235
- $ this ->getChannel ()->exchange_bind (
235
+ $ this ->getLibChannel ()->exchange_bind (
236
236
$ bind ->getTarget ()->getTopicName (),
237
237
$ bind ->getSource ()->getTopicName (),
238
238
$ bind ->getRoutingKey (),
@@ -241,7 +241,7 @@ public function bind(InteropAmqpBind $bind)
241
241
);
242
242
// bind queue to exchange
243
243
} elseif ($ bind ->getSource () instanceof InteropAmqpQueue) {
244
- $ this ->getChannel ()->queue_bind (
244
+ $ this ->getLibChannel ()->queue_bind (
245
245
$ bind ->getSource ()->getQueueName (),
246
246
$ bind ->getTarget ()->getTopicName (),
247
247
$ bind ->getRoutingKey (),
@@ -250,7 +250,7 @@ public function bind(InteropAmqpBind $bind)
250
250
);
251
251
// bind exchange to queue
252
252
} else {
253
- $ this ->getChannel ()->queue_bind (
253
+ $ this ->getLibChannel ()->queue_bind (
254
254
$ bind ->getTarget ()->getQueueName (),
255
255
$ bind ->getSource ()->getTopicName (),
256
256
$ bind ->getRoutingKey (),
@@ -271,7 +271,7 @@ public function unbind(InteropAmqpBind $bind)
271
271
272
272
// bind exchange to exchange
273
273
if ($ bind ->getSource () instanceof InteropAmqpTopic && $ bind ->getTarget () instanceof InteropAmqpTopic) {
274
- $ this ->getChannel ()->exchange_unbind (
274
+ $ this ->getLibChannel ()->exchange_unbind (
275
275
$ bind ->getTarget ()->getTopicName (),
276
276
$ bind ->getSource ()->getTopicName (),
277
277
$ bind ->getRoutingKey (),
@@ -280,15 +280,15 @@ public function unbind(InteropAmqpBind $bind)
280
280
);
281
281
// bind queue to exchange
282
282
} elseif ($ bind ->getSource () instanceof InteropAmqpQueue) {
283
- $ this ->getChannel ()->queue_unbind (
283
+ $ this ->getLibChannel ()->queue_unbind (
284
284
$ bind ->getSource ()->getQueueName (),
285
285
$ bind ->getTarget ()->getTopicName (),
286
286
$ bind ->getRoutingKey (),
287
287
$ bind ->getArguments ()
288
288
);
289
289
// bind exchange to queue
290
290
} else {
291
- $ this ->getChannel ()->queue_unbind (
291
+ $ this ->getLibChannel ()->queue_unbind (
292
292
$ bind ->getTarget ()->getQueueName (),
293
293
$ bind ->getSource ()->getTopicName (),
294
294
$ bind ->getRoutingKey (),
@@ -309,7 +309,7 @@ public function close()
309
309
*/
310
310
public function setQos ($ prefetchSize , $ prefetchCount , $ global )
311
311
{
312
- $ this ->getChannel ()->basic_qos ($ prefetchSize , $ prefetchCount , $ global );
312
+ $ this ->getLibChannel ()->basic_qos ($ prefetchSize , $ prefetchCount , $ global );
313
313
}
314
314
315
315
/**
@@ -336,7 +336,7 @@ public function subscribe(InteropAmqpConsumer $consumer, callable $callback)
336
336
}
337
337
};
338
338
339
- $ consumerTag = $ this ->getChannel ()->basic_consume (
339
+ $ consumerTag = $ this ->getLibChannel ()->basic_consume (
340
340
$ consumer ->getQueue ()->getQueueName (),
341
341
$ consumer ->getConsumerTag (),
342
342
(bool ) ($ consumer ->getFlags () & InteropAmqpConsumer::FLAG_NOLOCAL ),
@@ -366,10 +366,10 @@ public function unsubscribe(InteropAmqpConsumer $consumer)
366
366
367
367
$ consumerTag = $ consumer ->getConsumerTag ();
368
368
369
- $ this ->getChannel ()->basic_cancel ($ consumerTag );
369
+ $ this ->getLibChannel ()->basic_cancel ($ consumerTag );
370
370
371
371
$ consumer ->setConsumerTag (null );
372
- unset($ this ->subscribers [$ consumerTag ], $ this ->getChannel ()->callbacks [$ consumerTag ]);
372
+ unset($ this ->subscribers [$ consumerTag ], $ this ->getLibChannel ()->callbacks [$ consumerTag ]);
373
373
}
374
374
375
375
/**
@@ -407,7 +407,7 @@ public function consume($timeout = 0)
407
407
/**
408
408
* @return AMQPChannel
409
409
*/
410
- private function getChannel ()
410
+ public function getLibChannel ()
411
411
{
412
412
if (null === $ this ->channel ) {
413
413
$ this ->channel = $ this ->connection ->channel ();
0 commit comments