<?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
// ...
}
?>