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

search for in the

配信/購読およびトピックの購読> <メッセージ
Last updated: Fri, 13 Nov 2009

view this page in

メッセージング操作

すべてのメッセージング操作は、接続オブジェクトのメソッドをコールすることで行います。 キューにメッセージを追加するには "send" メソッドを使用し、 キューからメッセージを取得するには "receive" メソッドを使用します。 その他のメソッドには、配信や購読機能、 そしてトランザクションの境界の制御などがあります。

例1 キューへのメッセージの追加および応答の取得

<?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) {
  
// 送信に失敗しました!
  
echo "Send failed ($conn->errno$conn->error";
} else {
  
$resp $conn->receive('queue://receive/test', array(SAM_CORRELID => $correlid));
}
?>



add a note add a note User Contributed Notes
メッセージング操作
There are no user contributed notes for this page.

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