PHP 8.3.4 Released!

Stomp::send

stomp_send

(PECL stomp >= 0.1.0)

Stomp::send -- stomp_sendEnvía un mensaje

Descripción

Estilo orientado a objetos (método):

public Stomp::send(string $destination, mixed $msg, array $headers = ?): bool

Estilo por procedimientos:

stomp_send(
    resource $link,
    string $destination,
    mixed $msg,
    array $headers = ?
): bool

Envía un mensaje a el Message Broker.

Parámetros

link

Sólo estilo por procediminetos: El identificador de enlace Stomp devuelto por stomp_connect().

destination

A dónde eenviar el mensaje

msg

Mensaje a enviar.

headers

Array asociativo conteniendo los headers adicionales (ejemplo: receipt).

Valores devueltos

Devuelve true en caso de éxito o false en caso de error.

Ejemplos

Vea stomp_ack().

Notas

Nota:

Un header de transacción puede ser especificado, indicando que el mensaje de Acknowledgment debería formar parte del nombre de la transacción.

Sugerencia

Stomp es inherentemente asíncrono. Comunicación sincrónica puede ser implementada agregando un header receipt. Esto ocasionará métodos para no devolver nada hasta que el servidor haya recibido un Acknowledgment del mensaje o hasta que el tiempo de espera para lectura se agote.

add a note

User Contributed Notes 1 note

up
-4
james dot mk dot green at gmail dot com
12 years ago
Without a receipt header your application will fire messages potentially faster than the broker can receive them at. The broker may issue failure notices however STOMP being asynchronous your client won't get to see it.

Without a receipt ActiveMQ (5.5.0) with ProducerFlowControl turned on drops messages (even persistent ones) and my application knows nothing about it (send() returned true). With receipt header specified the STOMP library handles the wait for the receipt acknowledgement for you - you are essentially automatically throttled.
To Top