I would like to connect with Azure Servicebus via PHP. The docs however from Microsoft itself are outdated and the libs mentioned and maintained by Microsoft are mostly abandoned.
If i am correct the Azure Servicebus follows the AMQP protocol? I am trying to connect via AMQP itself to the servicebus but no succes at all.
When i try to create a new connection with below an error is returned:
<?php
$connection = new AMQPStreamConnection(
'[[ REDACTED ]].servicebus.windows.net.',
5671,
'[[ REDACTED KEY NAME ]]',
'[[ REDACTED KEY ]]'
);
/*
Fatal error: Uncaught PhpAmqpLib\Exception\AMQPConnectionClosedException: Broken pipe or closed connection in /app/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php:171
Stack trace:
#0 /app/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/AMQPReader.php(157): PhpAmqpLib\Wire\IO\StreamIO->read(7)
#1 /app/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/AMQPReader.php(103): PhpAmqpLib\Wire\AMQPReader->rawread(7)
#2 /app/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php(586): PhpAmqpLib\Wire\AMQPReader->read(7)
#3 /app/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php(642): PhpAmqpLib\Connection\AbstractConnection->wait_frame(3)
#4 /app/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(235): PhpAmqpLib\Connection\AbstractConnection->wait_channel(0, 3)
#5 /app/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(352): PhpAmqpLib\Channel\AbstractChannel->next_frame(3)
#6 /app/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/Ab in /app/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php on line 171
*/
?>
Hope someone can help me in the right direction
Best, Pim
I am answering this question on my own since i came to the conclusion that there is actually not a valid answer available. The SDK from Microsoft has been abandoned and there is no actual PHP solution for this at this moment of writing.
For me this means we will not consume the service but start using RabbitMQ instead.