Azure / azure-sdk-for-php

Microsoft Azure SDK for PHP
http://azure.microsoft.com/en-us/develop/php/
Apache License 2.0
415 stars 276 forks source link

Service Bus Queue session is enabled #1024

Open Oleksandr-Yushchenko opened 1 year ago

Oleksandr-Yushchenko commented 1 year ago

Service Bus Queue session is enabled, so the listener must be configured with the option for session.

Is it possible to read messages from Service Bus Queue with session enabled? Looks like this SDK does not allow it. I'm trying to read messages:

$this->serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService($connectionString);
$options = new ReceiveMessageOptions();
$options->setPeekLock();
// Receive message.
$message = $this->serviceBusRestProxy->receiveQueueMessage($queue_name, $options);

And got error from message serviceBusRestProxy:

Fail:
Code: 405
Value: Method Not Allowed
details (if any): <Error><Code>405</Code><Detail>It is not possible for an entity that requires sessions to create a non-sessionful message receiver. TrackingId:xxxxxxxxxxxxx, SystemTracker:XXXXXXXXXX:Queue:XXXXXXXXXXXX, Timestamp:2023-03-16T10:38:22</Detail></Error>.