Creating a CICS request exit

The CICS® request exit is called by CICS Transaction Gateway in remote mode, to select a CICS server name for an ECI or ESI request. The CICS request exit can be used for request retry, dynamic server selection and for rejecting non-valid requests. If the server name returned by a CICS request exit is null, the request is sent to the default CICS server if one is specified in the configuration file (ctg.ini).

Before you begin

If a request fails with a retryable error and the retry limit has not been reached, the Gateway daemon calls the CICS request exit to select an alternative CICS server. The following errors are retryable:
  • The specified CICS server is no longer available (ECI_ERR_CICS_DIED or ESI_ERR_CICS_DIED).
  • There are insufficient communication resources to complete the request (ECI_ERR_RESOURCE_SHORTAGE or ESI_ERR_RESOURCE_SHORTAGE).
  • The specified CICS server is not available (ECI_ERR_NO_CICS or ESI_ERR_NO_CICS).

For an XA transaction, if a request is retried using a CICS request exit, the retry must use the same protocol as the original request. For example, a request that was originally attempted over EXCI cannot be retried over IPIC. If, on retry, the exit attempts to change the protocol used, the ERROR_EXIT_RETRY_INVALID return code is returned to the Client application and message CTG8468E is written to the error log.

You can pass a command to a CICS request exit dynamically using the CREXIT administration option; for more information see CICS request exit control.

Note: In CICS Transaction Gateway V9.1 the default encoding for files was changed from EBCDIC to UTF-8.

About this task

To configure and deploy a CICS request exit use the following steps:

Procedure

  1. Create a Java™ class that implements the com.ibm.ctg.ha.CICSRequestExit interface.
  2. Compile the Java class and package it into a JAR file.
  3. Copy the JAR file to a location in your HFS accessible by the Gateway daemon.
  4. Update the CLASSPATH environment variable in the Gateway daemon configuration to include the location of the JAR file containing your exit.
  5. Specify the fully qualified package name of your exit class by using the cicsrequestexit parameter in the configuration file (ctg.ini). For example, to deploy the sample RoundRobinCICSRequestExit, specify this:
    cicsrequestexit=com.ibm.ctg.samples.ha.RoundRobinCICSRequestExit
  6. Start the Gateway daemon.

Task Task

Feedback


Timestamp icon Last updated: Thursday, 2 March 2017


https://ut-ilnx-r4.hursley.ibm.com/tgzos_latest/help/topic/com.ibm.cics.tg.zos.doc//progguide/topics/cicsreqexit.html