Skip to content

Can't see proper error messsage #168

@chandra10207

Description

@chandra10207

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions