PHP Doku:: Connections - sam.connections.html

Verlauf / Chronik / History: (1) anzeigen

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

Ein Service von Reinhard Neidl - Webprogrammierung.

Beispiele

<<Beispiele

Messages>>

Connections

In order to perform any messaging and queueing functions a connection must be established with a messaging server by creating a SAMConnection object and calling its "connect" method, with a set of connection properties, to connect the PHP script to the messaging server. Until such time as the SAMConnection object is destroyed the connection will be maintained and available for use. All SAMConnection objects are destroyed when the PHP script exits.

A set of default properties may be used in connecting to a messaging server but as a minimum the PHP script must specify a protocol to be used.

Beispiel #1 Creating a connection and connecting to a remote WebSphere MQSeries Messaging Server

<?php
$conn 
= new SAMConnection();
$conn->connect(SAM_WMQ, array(SAM_HOST => 'myhost.mycompany.com',
                              
SAM_PORT => 1506,
                              
SAM_BROKER => 'mybroker'));
?>

Beispiel #2 Creating a connection and connecting to a remote WebSphere Application Server

<?php
$conn 
= new SAMConnection();
$conn->connect(SAM_WPM, array(SAM_ENDPOINTS => 'localhost:7278:BootstrapBasicMessaging',
                              
SAM_BUS => 'Bus1',
                              
SAM_TARGETCHAIN => 'InboundBasicMessaging'));
?>

Beispiel #3 Creating a connection and connecting to an MQTT server

<?php
$conn 
= new SAMConnection();
$conn->connect(SAM_MQTT, array(SAM_HOST => 'myhost.mycompany.com',
                               
SAM_PORT => 1883));
?>


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",...)