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

search for in the

SAMConnection->peekAll> <SAMConnection->isConnected
Last updated: Fri, 13 Nov 2009

view this page in

SAMConnection->peek

(PECL sam >= 0.1.0)

SAMConnection->peek メッセージをキューから読み込み、それをキューに残したままにする

説明

SAMConnection
SAMMessage peek ( string $target [, array $properties ] )

パラメータ

target

メッセージを取得するキューの識別子。

properties

オプションの連想配列で、読み込み操作を制御するパラメータを指定します。

プロパティ名 とりうる値
SAM_CORRELID これは、取得するメッセージの相関 ID 文字列です。 典型的な例は、"send" リクエストが返す相関 ID 文字列となります。
SAM_MESSAGEID これは、取得するメッセージのメッセージ ID です。

返り値

このメソッドは SAMMessage オブジェクトを返します。 エラーが発生した場合は FALSE を返します。

例1 キューから次のメッセージを取得し、そのままメッセージをキューに残す

<?php
$msg 
$conn->peek('queue://receive/test');

if (!
$msg) {
  
// 取得に失敗しました!
  
echo "Peek failed ($conn->errno$conn->error";
}
?>

例2 キューから指定したメッセージを取得し、そのままメッセージをキューに残す

<?php

$msg 
$conn->peek('queue://receive/test', array(SAM_MESSAGEID => $messageId));

?>



add a note add a note User Contributed Notes
SAMConnection->peek
There are no user contributed notes for this page.

SAMConnection->peekAll> <SAMConnection->isConnected
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites