Home

 

Use a server service object

 

This example shows how to define, use, and alter, a server service object to start a trigger monitor.

  1. A server service object is defined, using the following MQSC command:
    DEFINE SERVICE(S1) +
           CONTROL(QMGR) +
           SERVTYPE(SERVER) +
           STARTCMD('+MQ_INSTALL_PATH+bin/runmqtrm') +
           STARTARG('-m +QMNAME+ -q ACCOUNTS.INITIATION.QUEUE') +
           STOPCMD('+MQ_INSTALL_PATH+bin/amqsstop') +
           STOPARG('-m +QMNAME+ -p +MQ_SERVER_PID+')
    Where:

    • +MQ_INSTALL_PATH+ is a token representing the installation directory.

    • +QMNAME+ is a token representing the name of the queue manager.

    • ACCOUNTS.INITIATION.QUEUE is the initiation queue.

    • amqsstop is a sample program provided with WebSphere MQ which requests the queue manager to break all connections for the process id. amqsstop generates PCF commands, therefore the command server must be running.

    • +MQ_SERVER_PID+ is a token representing the process id passed to the stop program.

  2. An instance of the server service object will execute when the queue manager is next started. However, we will start an instance of the server service object immediately with the following MQSC command:
    START SERVICE(S1)

  3. The status of the server service process is displayed, using the following MQSC command:
    DISPLAY SVSTATUS(S1)

  4. This example now shows how to alter the server service object and have the updates picked up by manually restarting the server service process. The server service object is altered so that the initiation queue is specified as JUPITER.INITIATION.QUEUE. The following MQSC command is used:
    ALTER SERVICE(S1) +
          STARTARG('-m +QMNAME+ -q JUPITER.INITIATION.QUEUE')

    A running service will not pick up any updates to its service definition until it is restarted.

  5. The server service process is restarted so that the alteration is picked up, using the following MQSC commands:
    STOP SERVICE(S1)
    Followed by:
    START SERVICE(S1)
    The server service process is restarted and picks up the alterations made in 4.

    The MQSC command, STOP SERVICE, can only be used if a STOPCMD argument is specified in the service definition.

 

Parent topic:

Examples on using service objects


fa11460_


 

Home