Класс Stomp

(PECL stomp >= 0.1.0)

Введение

Представляет связь между PHP и Stomp совместимым брокером сообщений (Message Broker).

Обзор классов

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

Содержание

  • Stomp::abort — Отменяет выполнение текущей транзакции
  • Stomp::ack — Подтверждает получение сообщения
  • Stomp::begin — Создает транзакцию
  • Stomp::commit — Выполняет текущую транзакцию
  • Stomp::__construct — Открывает соединение
  • Stomp::__destruct — Закрывает Stomp-соединение
  • Stomp::error — Возвращает последнюю ошибку Stomp
  • Stomp::getReadTimeout — Возвращает время максимального ожидания операции чтения
  • Stomp::getSessionId — Возвращает идентификатор текущей сессии Stomp
  • Stomp::hasFrame — Проверяет, возможно ли чтение фрейма
  • Stomp::readFrame — Выполняет операцию чтения следующего фрейма
  • Stomp::send — Отправляет сообщение
  • Stomp::setReadTimeout — Устанавливает предельное время ожидания операции чтения
  • Stomp::subscribe — Регистрирует подписку на указанную рассылку
  • Stomp::unsubscribe — Удаляет существующую подписку

Коментарии

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 ));
?>
2017-07-12 22:09:49
http://php5.kiev.ua/manual/ru/class.stomp.html

    Поддержать сайт на родительском проекте КГБ