Skip to content

Commit f1ff387

Browse files
committed
Introduce generic amqp\rabbitmq transport factories.
1 parent f7f6cc0 commit f1ff387

23 files changed

Lines changed: 304 additions & 1367 deletions

‎pkg/amqp-bunny/AmqpConnectionFactory.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Enqueue\AmqpBunny;
44

5-
use Bunny\Client;
65
use Enqueue\AmqpTools\ConnectionConfig;
76
use Enqueue\AmqpTools\DelayStrategyAware;
87
use Enqueue\AmqpTools\DelayStrategyAwareTrait;
@@ -18,7 +17,7 @@ class AmqpConnectionFactory implements InteropAmqpConnectionFactory, DelayStrate
1817
private $config;
1918

2019
/**
21-
* @var Client
20+
* @var BunnyClient
2221
*/
2322
private $client;
2423

@@ -82,7 +81,7 @@ public function getConfig()
8281
}
8382

8483
/**
85-
* @return Client
84+
* @return BunnyClient
8685
*/
8786
private function establishConnection()
8887
{
@@ -96,9 +95,10 @@ private function establishConnection()
9695
$bunnyConfig['read_write_timeout'] = min($this->config->getReadTimeout(), $this->config->getWriteTimeout());
9796
$bunnyConfig['timeout'] = $this->config->getConnectionTimeout();
9897

98+
// @see https://github.com/php-enqueue/enqueue-dev/issues/229
9999
// $bunnyConfig['persistent'] = $this->config->isPersisted();
100100
// if ($this->config->isPersisted()) {
101-
// $bunnyConfig['path'] = $this->config->getOption('path', $this->config->getOption('vhost'));
101+
// $bunnyConfig['path'] = 'enqueue';//$this->config->getOption('path', $this->config->getOption('vhost'));
102102
// }
103103

104104
if ($this->config->getHeartbeat()) {
@@ -109,7 +109,7 @@ private function establishConnection()
109109
$bunnyConfig['tcp_nodelay'] = $this->config->getOption('tcp_nodelay');
110110
}
111111

112-
$this->client = new Client($bunnyConfig);
112+
$this->client = new BunnyClient($bunnyConfig);
113113
$this->client->connect();
114114
}
115115

‎pkg/amqp-bunny/BunnyClient.php‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Enqueue\AmqpBunny;
4+
5+
use Bunny\Client;
6+
use Bunny\Exception\ClientException;
7+
8+
class BunnyClient extends Client
9+
{
10+
public function __destruct()
11+
{
12+
// try {
13+
parent::__destruct();
14+
// } catch (ClientException $e) {
15+
// if ('' === $e->getMessage()
16+
// }
17+
}
18+
}

‎pkg/amqp-bunny/Symfony/AmqpBunnyTransportFactory.php‎

Lines changed: 0 additions & 140 deletions
This file was deleted.

‎pkg/amqp-bunny/Symfony/RabbitMqAmqpBunnyTransportFactory.php‎

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)