Skip to content

Commit 8ad955c

Browse files
committed
rename
1 parent 2680588 commit 8ad955c

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

packages/Amqp/src/AmqpBackedMessageChannelBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ private function getAmqpOutboundChannelAdapter(): AmqpOutboundChannelAdapterBuil
5353
return $this->outboundChannelAdapter;
5454
}
5555

56-
public function withDeliveryGuarantee(bool $deliveryGuarantee): self
56+
public function withPublisherAcknowledgments(bool $enabled): self
5757
{
58-
$this->getAmqpOutboundChannelAdapter()->withDeliveryGuarantee($deliveryGuarantee);
58+
$this->getAmqpOutboundChannelAdapter()->withPublisherAcknowledgments($enabled);
5959

6060
return $this;
6161
}

packages/Amqp/src/AmqpOutboundChannelAdapter.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ class AmqpOutboundChannelAdapter implements MessageHandler
3131
private $initialized = false;
3232

3333
public function __construct(
34-
private CachedConnectionFactory $connectionFactory,
35-
private AmqpAdmin $amqpAdmin,
36-
private string $exchangeName,
37-
private ?string $routingKey,
38-
private ?string $routingKeyFromHeaderName,
39-
private ?string $exchangeFromHeaderName,
40-
private bool $defaultPersistentDelivery,
41-
private bool $autoDeclare,
42-
private bool $deliveryGuarantee,
43-
private OutboundMessageConverter $outboundMessageConverter,
44-
private ConversionService $conversionService,
34+
private CachedConnectionFactory $connectionFactory,
35+
private AmqpAdmin $amqpAdmin,
36+
private string $exchangeName,
37+
private ?string $routingKey,
38+
private ?string $routingKeyFromHeaderName,
39+
private ?string $exchangeFromHeaderName,
40+
private bool $defaultPersistentDelivery,
41+
private bool $autoDeclare,
42+
private bool $publisherAcknowledgments,
43+
private OutboundMessageConverter $outboundMessageConverter,
44+
private ConversionService $conversionService,
4545
private AmqpTransactionInterceptor $amqpTransactionInterceptor,
4646
) {
4747
}
@@ -82,7 +82,7 @@ public function handle(Message $message): void
8282

8383
/** @var AmqpContext $context */
8484
$context = $this->connectionFactory->createContext();
85-
if ($this->deliveryGuarantee && !$this->amqpTransactionInterceptor->isRunningInTransaction()) {
85+
if ($this->publisherAcknowledgments && !$this->amqpTransactionInterceptor->isRunningInTransaction()) {
8686
/** Ensures no messages are lost along the way when heartbeat is lost and ensures messages was peristed on the Broker side. Without this message can be simply "swallowed" without throwing exception */
8787
$context->getExtChannel()->confirmSelect();
8888
}
@@ -94,7 +94,7 @@ public function handle(Message $message): void
9494
// this allow for having queue per delay instead of queue per delay + exchangeName
9595
->send(new AmqpTopic($exchangeName), $messageToSend);
9696

97-
if ($this->deliveryGuarantee && !$this->amqpTransactionInterceptor->isRunningInTransaction()) {
97+
if ($this->publisherAcknowledgments && !$this->amqpTransactionInterceptor->isRunningInTransaction()) {
9898
$context->getExtChannel()->waitForConfirm();
9999
}
100100
}

packages/Amqp/src/AmqpOutboundChannelAdapterBuilder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class AmqpOutboundChannelAdapterBuilder extends EnqueueOutboundChannelAdapterBui
2727
private string $exchangeName;
2828
private bool $defaultPersistentDelivery = self::DEFAULT_PERSISTENT_MODE;
2929
private array $staticHeadersToAdd = [];
30-
private bool $deliveryGuarantee = true;
30+
private bool $publisherAcknowledgments = true;
3131

3232
private function __construct(string $exchangeName, string $amqpConnectionFactoryReferenceName)
3333
{
@@ -58,9 +58,9 @@ public function withDefaultRoutingKey(string $routingKey): self
5858
return $this;
5959
}
6060

61-
public function withDeliveryGuarantee(bool $deliveryGuarantee): self
61+
public function withPublisherAcknowledgments(bool $publisherAcknowledgments): self
6262
{
63-
$this->deliveryGuarantee = $deliveryGuarantee;
63+
$this->publisherAcknowledgments = $publisherAcknowledgments;
6464

6565
return $this;
6666
}
@@ -134,7 +134,7 @@ public function compile(MessagingContainerBuilder $builder): Definition
134134
$this->exchangeFromHeader,
135135
$this->defaultPersistentDelivery,
136136
$this->autoDeclare,
137-
$this->deliveryGuarantee,
137+
$this->publisherAcknowledgments,
138138
$outboundMessageConverter,
139139
new Reference(ConversionService::REFERENCE_NAME),
140140
Reference::to(AmqpTransactionInterceptor::class),

packages/Amqp/tests/Integration/AmqpMessageChannelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function test_sending_and_receiving_without_delivery_guarantee()
7474
->withSkippedModulePackageNames(ModulePackageList::allPackagesExcept([ModulePackageList::AMQP_PACKAGE]))
7575
->withExtensionObjects([
7676
AmqpBackedMessageChannelBuilder::create($queueName)
77-
->withDeliveryGuarantee(false),
77+
->withPublisherAcknowledgments(false),
7878
])
7979
);
8080

0 commit comments

Comments
 (0)