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:
- Calls the
AddSubjectvirtual method to bind theRIV::Appobject to message broker. TheAddSubjectvirtual method takes two parameters:$subject— Specifies the message broker subject to which theRIV::Appobject binds. In this call, the message broker subject isITNM/MODEL/NOTIFY.Note: If you wanted the Listener application to listen to events, then$subjectwould beITNM/EVENT/NOTIFY.$tag— Specifies the tag to be appended toUSER_, which describes the message returned through theRIV::GetResultmethod. In this call, the tag ismodel.
Upon successful completion, the
AddSubjectvirtual method returns the value 1. - Calls the
printoperator to print the value that theAddSubjectvirtual method returns to the standard output.