Bind the RIV::App object to the message broker subject for Listener

Network Manager uses the message broker publish and subscribe messaging system to enable processes to communicate with each other. This section of the Listener example script binds the newly created RIV::App object to message broker. Use this part of the example script as a guide to binding RIV::App objects to message broker.

The Listener example script binds the newly created RIV::App object to message broker as follows.


 $ok = $app->RIV::AddSubject('ITNM/MODEL/NOTIFY','model');  1 
 print $ok, "\n";  2 

The following list explains the specific numbered items in the previously listed section of the Listener Perl script example:

  1. Calls the AddSubject virtual method to bind the RIV::App object to message broker. The AddSubject virtual method takes two parameters:
    • $subject — Specifies the message broker subject to which the RIV::App object binds. In this call, the message broker subject is ITNM/MODEL/NOTIFY.
      Note: If you wanted the Listener application to listen to events, then $subject would be ITNM/EVENT/NOTIFY.
    • $tag — Specifies the tag to be appended to USER_, which describes the message returned through the RIV::GetResult method. In this call, the tag is model.

    Upon successful completion, the AddSubject virtual method returns the value 1.

  2. Calls the print operator to print the value that the AddSubject virtual method returns to the standard output.