downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Conexión AMQP> <Constantes predefinidas
Last updated: Fri, 20 May 2011

view this page in

Ejemplos

Example #1 Ejemplo de AMQP

<?php

// Crear una conexión
$cnn = new AMQPConnection();
$cnn->connect();

// Declara un nuevo intercambio
$ex = new AMQPExchange($cnn);
$ex->declare('exchange1'AMQP_EX_TYPE_FANOUT);

// Crear una nueva cola
$q = new AMQPQueue($cnn);
$q->declare('queue1');

// Atarlo en el intercambio a routing.key
$ex->bind('queue1''routing.key');

// Publicar un mensaje en el intercambio con una clave de ruta
$ex->publish('message''routing.key');

// Leer de la cola
$msg $q->consume();

?>


add a note add a note User Contributed Notes Ejemplos
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites