downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<MessagesPublish/Subscribe and suscriptions to topics>
Last updated: Thu, 26 Jun 2008

Messaging operations

All messaging operations are performed through calls to methods on the connection object. To add a message to a queue the "send" method is used, to obtain a message from a queue the "receive" method is used. Other methods provide publish and subscribe functionality and control of transaction boundaries.

Example #1 Adding a message to a queue and receiving a response

<?php
$msg
= new SAMMessage('This is a simple text message');
$msg->header->SAM_REPLY_TO = 'queue://receive/test';
$correlid = $conn->send('queue://send/test', $msg);

if (!
$correlid) {
 
// The Send failed!
 
echo "Send failed ($conn->errno) $conn->error";
} else {
 
$resp = $conn->receive('queue://receive/test', array(SAM_CORRELID => $correlid));
}
?>



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




<MessagesPublish/Subscribe and suscriptions to topics>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs