You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
[Contents]
When the Service Bus receiving process is executed based on the following reference material, it takes about 6 seconds to complete the execution when the message to be received is 0.
If the message to be received is 0, it takes about 6 seconds to complete the process. If the message is 1 or more, it takes about 1 second to complete the process.
We have obtained and checked the network trace (HAR file), but could not find the cause of the delay.
In order to determine which process is taking the longest time, we used the TIME function in the PHP process to verify.
Source code for receiving process.
<html>
<head><title>PHP TEST</title></head>
<body>
<?php
require_once 'vendor/autoload.php';
use WindowsAzure\Common\ServicesBuilder;
use WindowsAzure\Common\ServiceException;
use WindowsAzure\ServiceBus\Models\ReceiveMessageOptions;
$connectionString = "Endpoint=https://[Resource Name].servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=[SharedAccessKey]";
echo "section 1 start time : ".time()."<br />";
$serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService($connectionString);
echo "section 1 end time : ".time()."<br />";
try {
// Set receive mode to PeekLock (default is ReceiveAndDelete)
$options = new ReceiveMessageOptions();
echo "section 2 start time : ".time()."<br />";
$options->setPeekLock();
echo "section 2 end time : ".time()."<br />";
// Get message.
echo "section 3 start time : ".time()."<br />";
$message = $serviceBusRestProxy->receiveSubscriptionMessage("
[Service Bus Topic]", "[Service Bus Subscription]", $options);
echo "section 3 end time : ".time()."<br />";
if ($message !== null) {
echo "Body: ".$message->getBody()."<br />";
echo "MessageID: ".$message->getMessageId()."<br />";
// Delete message. Not necessary if peek lock is not set.
echo "Deleting message...<br />";
echo "section 4 start time : ".time()."<br />";
$serviceBusRestProxy->deleteMessage($message);
echo "section 4 end time : ".time()."<br />";
} else {
echo "Not Exists<br />";
}
}
catch(ServiceException $e){
// Handle exception based on error codes and messages.
// Error codes and messages are here:
// https://docs.microsoft.com/rest/api/storageservices/Common-REST-API-Error-Codes
$code = $e->getCode();
$error_message = $e->getMessage();
echo $code.": ".$error_message."<br />";
}
?>
</body>
</html>
Messages 0 : 5.86 seconds
section 3 start time : 1618902752
section 3 end time : 1618902758
It took about 6 seconds to receive the message.
I ran it several times, and it took about 5 or 6 seconds at all the same receiving points.
One message: 1.43 seconds
If the message is 1 or more, the receiving process will be completed in about 1 second.
[Contents]
When the Service Bus receiving process is executed based on the following reference material, it takes about 6 seconds to complete the execution when the message to be received is 0.
If the message to be received is 0, it takes about 6 seconds to complete the process. If the message is 1 or more, it takes about 1 second to complete the process.
We have obtained and checked the network trace (HAR file), but could not find the cause of the delay.
In order to determine which process is taking the longest time, we used the TIME function in the PHP process to verify.
Source code for receiving process.
section 3 start time : 1618902752
section 3 end time : 1618902758
It took about 6 seconds to receive the message.
I ran it several times, and it took about 5 or 6 seconds at all the same receiving points.
One message: 1.43 seconds
If the message is 1 or more, the receiving process will be completed in about 1 second.
https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-php-how-to-use-topics-subscriptions#receive-messages-from-a-subscription
And, we also checked the source code of the SDK below, but could not find the reason why it takes so long to complete the receiving process when there are zero messages.
https://github.com/Azure/azure-sdk-for-php/blob/e80e1a2de183d9894613a19ac243c4f4796a67ee/src/ServiceBus/ServiceBusRestProxy.php#L 224
[Question.]
If there are zero messages, what causes the process to take so long to complete?
The text was updated successfully, but these errors were encountered: