Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : SAM - Simple Asynchronous Messaging : SAMMessage->header

SAMMessage->header

The header properties of the message. ()

Example 2137. Setting a text format property using the default syntax

<?php
$msg
= new SAMMessage();

$msg->header->myPropertyName = 'textData';
?>

Example 2138. Setting a text format property using a type hint

<?php
$msg
= new SAMMessage();

$msg->header->myPropertyName = array('textData', SAM_STRING);
?>

Example 2139. Setting properties as the sender of a message

<?php
$msg
= new SAMMessage('This is a test message');

// defining SAM specific properties...
$msg->header->SAM_REPLY_TO = 'queue://test/replyQueue';

// defining arbitrary properties...
//
// a default string property
$msg->header->myStringProp1 = 'a string property';
// a string property with a type hint
$msg->header->myStringProp2 = array('another string property', SAM_STRING);

// a boolean property
$msg->header->myBoolProp = array(FALSE, SAM_BOOL);

// numeric format properties
$msg->header->myIntProp = array(32768, SAM_INT);
$msg->header->myLongProp = array(9876543, SAM_LONG);
$msg->header->myByteProp1 = array(123, SAM_BYTE);
$msg->header->myByteProp2 = array('12', SAM_BYTE);
$msg->header->myFloatProp = array(3.141592, SAM_FLOAT);
$msg->header->myDoubleProp = array(3.14159265358979, SAM_DOUBLE);
?>

Example 2140. Retreiving property values from a message

<?php

// accessing an application specific property
$intProp = $msg->header->'MyIntProp';

// accessing a messaging system specific property
$encoding = $msg->header->'JMS_IBM_Msgtype';

?>

Change Language


Follow Navioo On Twitter
SAMConnection->commit()
SAMConnection->connect()
SAMConnection->__construct()
SAMConnection->disconnect()
SAMConnection->errno
SAMConnection->error
SAMConnection->isConnected()
SAMConnection->peek()
SAMConnection->peekAll()
SAMConnection->receive()
SAMConnection->remove()
SAMConnection->rollback()
SAMConnection->send()
SAMConnection::setDebug()
SAMConnection->subscribe()
SAMConnection->unsubscribe()
SAMMessage->body
SAMMessage->__construct()
SAMMessage->header
eXTReMe Tracker