Stomp 类

(PECL stomp >= 0.1.0)

介绍

表示 PHP 和符合 Stomp 标准的消息代理之间的连接。

类概要

class Stomp {
/* 方法 */
public __construct(
    string $broker = ini_get("stomp.default_broker_uri"),
    string $username = ?,
    string $password = ?,
    array $headers = ?
)
public abort(string $transaction_id, array $headers = ?): bool
stomp_abort(resource $link, string $transaction_id, array $headers = ?): bool
public ack(mixed $msg, array $headers = ?): bool
stomp_ack(resource $link, mixed $msg, array $headers = ?): bool
public begin(string $transaction_id, array $headers = ?): bool
stomp_begin(resource $link, string $transaction_id, array $headers = ?): bool
public commit(string $transaction_id, array $headers = ?): bool
stomp_commit(resource $link, string $transaction_id, array $headers = ?): bool
stomp_connect(
    string $broker = ini_get("stomp.default_broker_uri"),
    string $username = ?,
    string $password = ?,
    array $headers = ?
): resource
stomp_close(resource $link): bool
public error(): string
stomp_error(resource $link): string
stomp_get_read_timeout(resource $link): array
stomp_get_session_id(resource $link): string|false
public hasFrame(): bool
stomp_has_frame(resource $link): bool
public readFrame(string $class_name = "stompFrame"): stompframe
stomp_read_frame(resource $link): array
public send(string $destination, mixed $msg, array $headers = ?): bool
stomp_send(
    resource $link,
    string $destination,
    mixed $msg,
    array $headers = ?
): bool
public setReadTimeout(int $seconds, int $microseconds = ?): void
stomp_set_read_timeout(resource $link, int $seconds, int $microseconds = ?): void
public subscribe(string $destination, array $headers = ?): bool
stomp_subscribe(资源 $link, 字符串 $destination, 数组 $headers = ?): 布尔值
public unsubscribe(字符串 $destination, 数组 $headers = ?): 布尔值
stomp_unsubscribe(资源 $link, 字符串 $destination, 数组 $headers = ?): 布尔值
public __destruct()
}

目录

添加说明

用户贡献说明 1 个说明

guilherme dot geronimo at gmail dot com
7 年前
在某些情况下(例如 ActiveMQ),当您有许多消费者时,您需要在连接过程中识别您的“client-id”,否则服务器可能会误解您的连接并创建新的主题/队列

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