简体   繁体   中英

Azure SDK for PHP and Service Bus for Windows Server 1.1

Does the current Azure SDK for PHP supports Service Bus for Windows Server 1.1? And if it does, how it should be configured in order to successfully connect and post to the bus?

I found that there is an additional parameter in the connection string, that can change the StsEndpoint and I used it to use STS of the Service Bus, but I am receiving <Error><Code>404</Code><Detail>No service is hosted at the specified address.. .

The code I am using:

<?php

echo "Here we go...\n";

require_once 'vendor/autoload.php';

use WindowsAzure\Common\ServicesBuilder;
use WindowsAzure\Common\ServiceException;
use WindowsAzure\ServiceBus\Models\BrokeredMessage;

echo "Create Service Bus REST proxy.\n";

$connectionString = 'Endpoint=sb://myhost.mydomain/myNamespace;StsEndpoint=https://myhost.mydomain:9355/myNamespace;SharedSecretIssuer=theSASName;SharedSecretValue=theSASKey';

$serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService($connectionString);


try {
    echo "Create message. \n";
    $message = new BrokeredMessage();
    $message->setBody("my message");

    echo "Send message. \n";
    $serviceBusRestProxy->sendQueueMessage("my-queue", $message);
} catch(ServiceException $e) {
    $code = $e->getCode();
    $error_message = $e->getMessage();
    echo $code . ": " . $error_message .";\n";
}

echo "The End! \n";

?>

@Tsvetelin,

According to official document about SDK, it is confirmed that Azure Service bus SDK 2.1 compatible with service bus 1.1. Please see the image below and the document( https://msdn.microsoft.com/en-us/library/dn441398.aspx ). 在此输入图像描述

Another potential issue is that I recommend you can check whether your services were running using 'Get-SBFarmStatus' . Any update, please let me know.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM