Qorus Integration Engine  3.0.4.p7
Working With Services

Contents of this section:

Call a System Service Method

Use the ocmd command to call a system service method. Using this command, parameters can also be easily passed to the service method as well. If the service is not already loaded, then it is loaded and initialized before the method is called.

The syntax is as follows:

unixprompt% ocmd omq.system.service.<name>.<method> [params] 

The command’s output is dependent on the service method being called. Here is the output for the omq.system.service.omqmap.reload() method:

OK 

If an error message appears, see the following section for causes.

Common Errors

Error: No Such Service

Error Message:
ERROR: OMQ-NO-SERVICE: system service "<name>" does not exist 
Explanation:
The service does not exist in the Qorus database.

Possible Cause Action to Take
The service name is incorrect Check the service name and type and try the command again.

Error: No Such Method

Error Message:
ERROR: OMQ-SERVICE-NO-METHOD: system service <name>/<ver> has not registered method "<method>" (available methods: <list>) 
Explanation:
The method does not exist in this service.
Possible Cause Action to Take
The method name is incorrect Check the method name against the list returned in the error message, and try the command again.

Error: Communication, Authentication, and Environment Error

See Common Client Errors for more information. These errors could affect any network client, including Qorus command-line tools.


Call a User Service Method

Calling a user service is just like calling a system service, except the word “system" is replaced with “user" in the command line. If the service is not already loaded, then it is loaded and initialized before the method is called.

The syntax is as follows:

unixprompt% ocmd omq.user.service.<name>.<method> [params] 

The command’s output is dependent on the service method being called. Here is example output for a hypothetical user method that gives no output but returns success:

OK 

If an error message appears, see the following section for causes.

Common Errors

Error: No Such Service

Error Message:
ERROR: OMQ-NO-SERVICE: user service "<name>" does not exist 
Explanation:
The service does not exist in the Qorus database.
Possible Cause Action to Take
The service name is incorrect Check the service name and type and try the command again.

Error: No Such Method

Error Message:
ERROR: OMQ-SERVICE-NO-METHOD: user service <name>/<ver> has not registered method "<method>" (available methods: <list>) 
Explanation:
The method does not exist in this service.
Possible Cause Action to Take
The method name is incorrect Check the method name against the list returned in the error message, and try the command again.

Error: Communication, Authentication, and Environment Error

See Common Client Errors for more information. These errors could affect any network client, including Qorus command-line tools.


Stop or Unload a System Service

To stop a system service, it must be deleted from the Qorus service cache by calling the omq.system.delete-service() API method with the service’s name as the only parameter as follows:

unixprompt% ocmd [omq.system.]delete-service <service> 

If the service is currently loaded, then it will be deleted. If it is running, it will be stopped before it’s deleted. The output should look as follows:

OK 

If an error message appears, see the following section for causes.

Note
Because services are loaded and initialized automatically when a method is called, stopping or deleting a service will only be effective if no more calls to that service are made either internally or externally.
Common Errors

Error: No Such Service

Error Message:
ERROR: OMQ-NO-SERVICE: system service "<name>" does not exist 
Explanation:
The service does not exist in the Qorus database.
Possible Cause Action to Take
The service name is incorrect Check the service name and type and try the command again
The service is not currently loaded Take no action, because the service has either already been unloaded or was never loaded

Error: Communication, Authentication, and Environment Error

See Common Client Errors for more information. These errors could affect any network client, including Qorus command-line tools.


Stop a User Service

Stopping a user service is very similar to stopping a system service. To stop a user service, call the omq.user.delete-service() API method with the service’s name as the only parameter as follows:

unixprompt% ocmd omq.user.delete-service <service> 

If the service is currently loaded, then it will be deleted. If it is running, it will be stopped before it’s deleted. The output should look as follows:

OK 

If an error message appears, see the following section for causes.

Note
Because services are loaded and initialized automatically when a method is called, stopping or deleting a service will only be effective if no more calls to that service are made either internally or externally.
Common Errors

Error: No Such Service

Error Message:
ERROR: OMQ-NO-SERVICE: user service "<name>" does not exist 
Explanation:
The service does not exist in the Qorus database.
Possible Cause Action to Take
The service name is incorrect Check the service name and type and try the command again
The service is not currently loaded Take no action, because the service has either already been unloaded or was never loaded

Error: Communication, Authentication, and Environment Error

See Common Client Errors for more information. These errors could affect any network client, including Qorus command-line tools.


Perform a Live Upgrade of a Service

Upgrading a service involves the following steps:

  • Load the new version of the service in the database.
  • Reset the service

Use the ostatus –sv command to verify that the correct version of the service is loaded.

For instance if user service “service" version 1.0 is being replaced with “service" version 1.1, then the following commands will perform a live upgrade of the service:

unixprompt% oload @service-release-1.1.qrf
...
unixprompt% ocmd omq.user.reset-service service
OK