I am using ActiveMQ on AmazonMQ as a broker.
When I try to connect, It always shows the exemption message "Unable to connect broker". I am not sure is it an issues with logins or port?
require __DIR__ . '/../vendor/autoload.php';
use Stomp\Client;
use Stomp\Network\Connection;
use Stomp\StatefulStomp;
use Stomp\Transport\Message;
use Stomp\Exception\ConnectionException;
use Stomp\Network\Observer\HeartbeatEmitter;
use Stomp\Transport\Frame;
use Stomp\Exception\StompException;
use Stomp\Stomp;
$brokerUri = '....';
$connection = new Connection($brokerUri);
$client = new Client($connection);
$client->setLogin($username, $pass);
// connect
try {
$client->connect();
} catch (ConnectionException $e) {
echo "Connections ERROR: \n". PHP_EOL;
echo $e->getMessage() . PHP_EOL;;
}
Is there anything I am missing?
I am using ActiveMQ on AmazonMQ as a broker.
When I try to connect, It always shows the exemption message "Unable to connect broker". I am not sure is it an issues with logins or port?
Is there anything I am missing?