The Stomp class

(PECL stomp >= 0.1.0)

はじめに

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

クラス概要

class Stomp {
/* メソッド */
public function __construct(
    string $broker = ini_get("stomp.default_broker_uri"),
    string $username = ?,
    string $password = ?,
    array $headers = ?
)
public function abort(string $transaction_id, array $headers = ?): bool
function stomp_abort(resource $link, string $transaction_id, array $headers = ?): bool
public function ack(mixed $msg, array $headers = ?): bool
function stomp_ack(resource $link, mixed $msg, array $headers = ?): bool
public function begin(string $transaction_id, array $headers = ?): bool
function stomp_begin(resource $link, string $transaction_id, array $headers = ?): bool
public function commit(string $transaction_id, array $headers = ?): bool
function stomp_commit(resource $link, string $transaction_id, array $headers = ?): bool
function stomp_connect(
    string $broker = ini_get("stomp.default_broker_uri"),
    string $username = ?,
    string $password = ?,
    array $headers = ?
): resource
function stomp_close(resource $link): bool
public function error(): string
function stomp_error(resource $link): string
public function getReadTimeout(): array
function stomp_get_read_timeout(resource $link): array
public function getSessionId(): string|false
function stomp_get_session_id(resource $link): string|false
public function hasFrame(): bool
function stomp_has_frame(resource $link): bool
public function readFrame(string $class_name = "stompFrame"): stompframe
function stomp_read_frame(resource $link): array
public function send(string $destination, mixed $msg, array $headers = ?): bool
function stomp_send(
    resource $link,
    string $destination,
    mixed $msg,
    array $headers = ?
): bool
public function setReadTimeout(int $seconds, int $microseconds = ?): void
function stomp_set_read_timeout(resource $link, int $seconds, int $microseconds = ?): void
public function subscribe(string $destination, array $headers = ?): bool
function stomp_subscribe(resource $link, string $destination, array $headers = ?): bool
public function unsubscribe(string $destination, array $headers = ?): bool
function stomp_unsubscribe(resource $link, string $destination, array $headers = ?): bool
public function __destruct()
}

目次

add a note

User Contributed Notes 1 note

up
1
guilherme dot geronimo at gmail dot com
8 years 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