mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
*** empty log message ***
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@224645 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
7ce67ea103
commit
8c6a1afe66
20 changed files with 183 additions and 45 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<section id="mq.constants">
|
||||
&reftitle.constants;
|
||||
&extension.constants;
|
||||
|
@ -356,6 +356,19 @@
|
|||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>SAM_WMQ_TARGET_CLIENT</constant>
|
||||
(<type>string</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Option name used on send requests to specify the target client mode. This can either be default to
|
||||
'jms' or 'mq'. The default is 'jms' which means an RFH2 header is sent with the message whereas the 'mq' setting
|
||||
means no RFH2 is included.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>SAM_WPM</constant>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Connection-commit'>
|
||||
<refnamediv>
|
||||
<refname>SAMConnection::commit()</refname>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Connection-connect'>
|
||||
<refnamediv>
|
||||
<refname>SAMConnection::connect()</refname>
|
||||
|
@ -195,6 +195,13 @@
|
|||
</para>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SAM_WPM_DUR_SUB_HOME</entry>
|
||||
<entry>none</entry>
|
||||
<entry>
|
||||
The name of the messaging engine where durable subscriptions are managed. (WPM ONLY).
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Connection-constructor'>
|
||||
<refnamediv>
|
||||
<refname>SAMConnection::SAMConnection()</refname>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Connection-disconnect'>
|
||||
<refnamediv>
|
||||
<refname>SAMConnection::disconnect()</refname>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id="function.SAM-Connection-errno">
|
||||
<refnamediv>
|
||||
<refname>SAMConnection->errno</refname>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id="function.SAM-Connection-error">
|
||||
<refnamediv>
|
||||
<refname>SAMConnection->error</refname>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Connection-isConnected'>
|
||||
<refnamediv>
|
||||
<refname>SAMConnection::isConnected()</refname>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Connection-peek'>
|
||||
<refnamediv>
|
||||
<refname>SAMConnection::peek()</refname>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id='function.SAM-Connection-peekAll'>
|
||||
<refnamediv>
|
||||
<refname>SAMConnection::peekAll()</refname>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Connection-receive'>
|
||||
<refnamediv>
|
||||
<refname>SAMConnection::receive()</refname>
|
||||
|
@ -28,7 +28,7 @@
|
|||
<term><parameter>target</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The identity of the queue from which to receive the message.
|
||||
The identity of the queue, topic or subscription from which to receive the message.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -115,6 +115,29 @@ $msg = $conn->receive('queue://receive/test', array(SAM_SELECT => $token, SAM_WA
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Receiving a message from a subscription</title>
|
||||
<para>
|
||||
In this example we show how to receive a message from a subscription id.
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$msg = $conn->receive($subscriptionName);
|
||||
|
||||
if (!$msg) {
|
||||
// The receive failed!
|
||||
echo "Receive failed ($conn->errno) $conn->error";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
Please note that $subscriptionName is a subscription id returned from an earlier subscribe call.
|
||||
</para>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Connection-remove'>
|
||||
<refnamediv>
|
||||
<refname>SAMConnection::remove()</refname>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Connection-rollback'>
|
||||
<refnamediv>
|
||||
<refname>SAMConnection::rollback()</refname>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Connection-send'>
|
||||
<refnamediv>
|
||||
<refname>SAMConnection::send()</refname>
|
||||
|
@ -91,6 +91,14 @@
|
|||
discarding it. The default value is 0 indicating the message should be retained indefinitely.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SAM_WMQ_TARGET_CLIENT</entry>
|
||||
<entry>
|
||||
This property is only valid when using WebSphere MQ and indicates whether or not an RFH2 header should be
|
||||
included with the message. This option may be set to either 'jms' or 'mq'. The default is 'jms' which means
|
||||
that an RFH2 header is included. If the value 'mq' is specified then no RFH2 is included with the message.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Connection-subscribe'>
|
||||
<refnamediv>
|
||||
<refname>SAMConnection::subscribe()</refname>
|
||||
<refpurpose>
|
||||
Create a subscription to one or more topics.
|
||||
Create a subscription to a specified topic.
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<para>
|
||||
The "subscribe" method is used to create a new subscription to one or more topics.
|
||||
The "subscribe" method is used to create a new subscription to a specified topic.
|
||||
</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SAMConnection</classname></ooclass>
|
||||
|
@ -20,9 +20,6 @@
|
|||
<methodparam><type>string</type><parameter>targetTopic</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Warning: This method is not currently implemented.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -44,7 +41,7 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
A subscription identifier that can be used in a subsequent receive call as a selector to obtain any topic data or &false; if an error occurred.
|
||||
A subscription identifier that can be used in a subsequent receive call as a selector to obtain any topic data or &false; if an error occurred. The subscription identifier should be used in the receive call in place of the simple topic name.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
@ -52,7 +49,7 @@
|
|||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Subscribe to a single topic</title>
|
||||
<title>Subscribe to a topic</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Connection-unsubscribe'>
|
||||
<refnamediv>
|
||||
<refname>SAMConnection::unsubscribe()</refname>
|
||||
<refpurpose>
|
||||
Cancel a subscription to one or more topics.
|
||||
Cancel a subscription to a specified topic.
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<para>
|
||||
The "unsubscribe" method is used to delete an existing subscription to one or more topics.
|
||||
The "unsubscribe" method is used to delete an existing subscription to a specified topic.
|
||||
</para>
|
||||
<classsynopsis>
|
||||
<ooclass><classname>SAMConnection</classname></ooclass>
|
||||
|
@ -21,9 +21,6 @@
|
|||
<methodparam choice='opt'><type>string</type><parameter>targetTopic</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</classsynopsis>
|
||||
<para>
|
||||
Warning: This method is not currently implemented.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -38,16 +35,6 @@
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>targetTopic</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An optional topic identifier of the topic for which the subscription is to be cancelled.
|
||||
If this value is not specified the subscription will be cancelled for all topics currently
|
||||
subscribed to.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
@ -63,11 +50,11 @@
|
|||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Unsubscribe from a single topic</title>
|
||||
<title>Delete a subscription</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
if (!$conn->unsubscribe($subid, 'topic://A')) {
|
||||
if (!$conn->unsubscribe($subid)) {
|
||||
// The unsubscribe failed!
|
||||
echo "Unsubscribe failed ($conn->errno) $conn->error";
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Message-body'>
|
||||
<refnamediv>
|
||||
<refname>SAMMessage::body</refname>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Message-constructor'>
|
||||
<refnamediv>
|
||||
<refname>SAMMessage::SAMMessage()</refname>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<refentry id='function.SAM-Message-header'>
|
||||
<refnamediv>
|
||||
<refname>SAMMessage::header</refname>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<reference id="ref.sam">
|
||||
<title>SAM - Simple Asynchronous Messaging</title>
|
||||
<titleabbrev>SAM</titleabbrev>
|
||||
|
@ -361,7 +361,110 @@ by using the freely distributable <ulink url="&url.ms.crt;">runtime package</uli
|
|||
</example>
|
||||
</para>
|
||||
</section> <!-- id=sam.operations -->
|
||||
<section id='sam.pubsub'>
|
||||
<title>Publish/Subscribe and suscriptions to topics</title>
|
||||
<para>
|
||||
SAM allows messages to be sent either to queues or, for WebSphere MQ and WPM, to publish/subscribe topics.
|
||||
A topic desintation is specified to SAM in the usual way, i.e. in the form 'topic://fred', rather than the form
|
||||
'queue://AQUEUE' used for point to point operation. To use publish/subscribe it is simply necessary to specify the
|
||||
correct broker name on the SAMConnect "connect" call and the desired topic in the destination argument to the SAMConnect "send"
|
||||
and "receive" calls. The PHP interface is otherwise identical to the point to point model.
|
||||
</para>
|
||||
<para>
|
||||
By default, SAM creates non-durable subscriptions when using publish/subscribe. This means that if a client application is
|
||||
inactive when messages are published to a topic, then it will not receive them when it subsequently restarted. SAM does also
|
||||
allow durable subscriptions to be made to topics when using WPM or WebSphere MQ publish/subscribe. The purpose of these
|
||||
subscriptions is to allow data to be received by a client application even if that client was not active at the time
|
||||
the data was published.
|
||||
</para>
|
||||
<para>
|
||||
Durable subscriptions are specified by using the SAMConnect "subscribe" call. This method takes the destination topic as an
|
||||
input parameter and returns a subscription identifier that may be used on subsequent "receive" calls. When the subscription
|
||||
is no longer required the SAMConnection "unsubscribe" method should be used to delete the subscription.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Creating a durable subscription to a topic</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$subName = $conn->subscribe('topic://A');
|
||||
|
||||
if (!$subName) {
|
||||
echo "Subscribe failed";
|
||||
} else {
|
||||
# Subscribe was OK
|
||||
...
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Subscribing to a topic using a WebSphere Platform Messaging (WPM) server</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$conn = new SAMConnection();
|
||||
// Note: For pub/sub on WPM, when connecting the name of a messaging engine
|
||||
// to hold the durable subscription (SAM_WPM_DUR_SUB_HOME) must be specified.
|
||||
$conn->connect(SAM_WMQ, array(SAM_ENDPOINTS => 'localhost:7278:BootstrapBasicMessaging',
|
||||
SAM_BUS => 'Bus1',
|
||||
SAM_TARGETCHAIN => 'InboundBasicMessaging'
|
||||
SAM_WPM_DUR_SUB_HOME => 'MyMachineNode01.server1-Bus1'));
|
||||
|
||||
$subName = $conn->subscribe('topic://A');
|
||||
|
||||
if (!$subName) {
|
||||
echo "Subscribe failed";
|
||||
} else {
|
||||
# Subscribe was OK
|
||||
...
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Receiving published data using a durable subscription</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$msg = $conn->receive($subName);
|
||||
if ($msg) {
|
||||
echo "Received a message OK";
|
||||
} else {
|
||||
echo "The receive failed";
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Deleting a durable subscription to a topic</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
if (!$conn->unsubscribe($subName)) {
|
||||
echo "Unsubscribe failed";
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</section> <!-- id=sam.pubsub -->
|
||||
<section id='sam.errors'>
|
||||
<title>Error handling</title>
|
||||
<para>
|
||||
|
|
Loading…
Reference in a new issue