PHP Doku:: Messages - sam.messages.html
Aktuelle Suchanfrage: 12f37b1c6963c1c5c18f30495416a197-simple-array png - 30 Treffer
  1 Messages
Messages - sam.messages.html
  2 ReflectionFunction::__construct
Constructs a ReflectionFunction object - reflectionfunction.construct.html
  3 Einführung
Einführung - intro.sam.html
  4 Memcached::set
Store an item - memcached.set.html
  5 xml_parse_into_struct
Parse XML data into an array structure - function.xml-parse-into-struct.html
  6 ob_get_status
Get status of output buffers - function.ob-get-status.html
  7 Memcached::fetch
Fetch the next result - memcached.fetch.html
  8 Memcached::fetchAll
Fetch all the remaining results - memcached.fetchall.html
  9 The ResourceBundle class
The ResourceBundle class - class.resourcebundle.html
 10 imagegd
Output GD image to browser or file - function.imagegd.html
mehr Ergebnisse anzeigen...

Bisherige Suchanfragen: (1) anzeigen

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSonstige DiensteSimple Asynchronous MessagingBeispieleMessages

Ein Service von Reinhard Neidl - Webprogrammierung.

Beispiele

<<Connections

Messaging operations>>

Messages

Messages sent to and received from queues are represented by the SAMMessage object. The SAMMessage object encapsulates the body of the message (if one exists) and the header properties associated with the message. A SAMMessage object is either supplied as a parameter to a messaging operation or returned as a result.

Beispiel #1 Creating a message with a simple text body

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

Messages may have header properties associated with them that provide control over the transport of the message or further information to the receiving application. By default message properties are delivered to the underlying messaging system as strings and in this case they may be set with the following simple syntax:

Beispiel #2 Setting a text format property using the default syntax

<?php
$msg
->header->myPropertyName 'textData';
?>

If it is desired to pass type information an alternative syntax may be used where the value and the type hint are passed in an associative array:

Beispiel #3 Setting a property using a type hint

<?php
$msg
->header->myPropertyName = array(3.14159SAM_FLOAT);
?>

Properties may also be extracted from the header of a message.

Beispiel #4 Retrieving a property from a message header

<?php
$myProperty 
$msg->header->myPropertyName;
?>


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)