Skip to content

Commit c3bb72e

Browse files
committed
dead policy Use the same name as the consumer
1 parent 7391ab5 commit c3bb72e

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ abstract class Client
4949
/**
5050
* Class library version
5151
*/
52-
const VERSION_ID = '1.2.0';
52+
const VERSION_ID = '1.2.1';
5353

5454
/**
5555
* @var Options

src/ConsumerOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function setReceiveQueueSize(int $size)
157157
* @return void
158158
* @throws OptionsException
159159
*/
160-
public function setDeadLetterPolicy(int $maxRedeliveryCount, string $deadLetterTopic = '', string $initialSubscriptionName = 'logic')
160+
public function setDeadLetterPolicy(int $maxRedeliveryCount, string $deadLetterTopic = '', string $initialSubscriptionName = '')
161161
{
162162
if ($maxRedeliveryCount <= 0) {
163163
throw new OptionsException('maxRedeliveryCount Must be greater than 0');

src/DeadLetterPolicy.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Pulsar\Authentication\Authentication;
1515
use Pulsar\Compression\Compression;
16+
use Pulsar\Exception\OptionsException;
1617

1718
/**
1819
* Class DeadLetterPolicy
@@ -39,23 +40,19 @@ class DeadLetterPolicy
3940
protected $options;
4041

4142

42-
/**
43-
* @var string
44-
*/
45-
const DEFAULT_SUBSCRIPTION = 'logic';
46-
47-
4843
/**
4944
* @param array $config
5045
* @param ConsumerOptions|null $options
46+
* @throws OptionsException
5147
*/
5248
public function __construct(array $config = [], ConsumerOptions $options = null)
5349
{
5450
$this->config = $config;
5551
$this->options = $options;
5652

5753
if (empty($this->config['subscription'])) {
58-
$this->config['subscription'] = self::DEFAULT_SUBSCRIPTION;
54+
// Consistent with consumers
55+
$this->config['subscription'] = $options->getSubscriptionName();
5956
}
6057
}
6158

0 commit comments

Comments
 (0)