PHPKonf Istanbul PHP Conference 2019 - Call for Papers

The Stomp class

(PECL stomp >= 0.1.0)

Introduction

Represents a connection between PHP and a Stomp compliant Message Broker.

Class synopsis

Stomp {
/* Methods */
public abort ( string $transaction_id [, array $headers ] ) : bool
public ack ( mixed $msg [, array $headers ] ) : bool
public begin ( string $transaction_id [, array $headers ] ) : bool
public commit ( string $transaction_id [, array $headers ] ) : bool
public __construct ([ string $broker = ini_get("stomp.default_broker_uri") [, string $username [, string $password [, array $headers ]]]] )
public __destruct ( void ) : bool
public error ( void ) : string
public getReadTimeout ( void ) : array
public getSessionId ( void ) : string
public hasFrame ( void ) : bool
public readFrame ([ string $class_name = "stompFrame" ] ) : stompframe
public send ( string $destination , mixed $msg [, array $headers ] ) : bool
public setReadTimeout ( int $seconds [, int $microseconds ] ) : void
public subscribe ( string $destination [, array $headers ] ) : bool
public unsubscribe ( string $destination [, array $headers ] ) : bool
}

Table of Contents

add a note add a note

User Contributed Notes 1 note

up
0
guilherme dot geronimo at gmail dot com
1 year ago
In some cases (E.g. ActiveMQ), when you have many consumers you need to identify your "client-id" during the connection process, otherwise the server can misunderstand your connection and create new topics/queues:

<?php
$stomp
= new Stomp($url, $user, $password, array('client-id'=> $clientId ));
?>
To Top