PublishMessage

The PublishMessage virtual method publishes the specified message string.

Virtual Method Synopsis

PublishMessage($subject, $message)

Parameters

$subject
Specifies the unqualified Network Manager subject used for message broker messaging.
$message
Specifies a valid ASCII message string.

Description

The PublishMessage virtual method publishes the message string specified in the $message parameter on the subject specified in the $subject parameter. The value specified in $subject must be unqualified, that is, it must be without the .DOMAIN suffix. The message in $message must be a valid ASCII string.

Example Usage

The following example assumes a previous call to the RIV::App constructor, which returns a client/server application object to $app. A call could also be made to the RIV::Agent constructor, which returns a discovery agent application object (typically, to $agent).

$ok = $app->PublishMessage('ITNM/MODEL/QUERY', "hello");

Returns

Upon completion, the PublishMessage virtual method returns:

  • 0 (zero) — The attempt to publish the specified message was unsuccessful.
  • 1 — The attempt to publish the specified message was successful.

See Also