Node.js pipeline considerations

Node.js applications can start a JSON pipeline in CICS® with an invoke function to call existing CICS programs that are enabled as JSON web services. It is possible to reuse an existing JSON pipeline with Node.js applications, subject to the following considerations.

Selecting a pipeline

An invoke function from a locally optimized Node.js application does not arrive in CICS over the HTTP protocol. Any pipeline that relies on the HTTP protocol might be unsuitable for use with Node.js. For example, if handler programs that are registered with the pipeline try to use the EXEC CICS WEB API to interact with headers from the HTTP request, an error response is received from CICS. For more information on invoke functions, see Calling CICS services.

If a pipeline is bound to a specific transport implementation through use of pipeline transport handler programs, that pipeline might be unsuitable for use with locally optimized invoke functions from Node.js applications. CICS selects a pipeline to use for a Node.js request based on matching the URI specified on the invoke function with the URIMAP resources. The associated URIMAPs must indicate USAGE(PIPELINE). If USAGE(PIPELINE) is not indicated, the URIMAPs are not suitable for use with locally optimized invoke functions from Node.js applications.

If a URIMAP is bound to a specific TCPIPSERVICE resource, that URIMAP accepts work only from that TCPIPSERVICE. Locally optimized invoke functions from Node.js applications do not use HTTP - they bypass the TCPIPSERVICE resource. Any such URIMAPs are unsuitable for use with locally optimized request from a Node.js application invoke functions.

Pipeline handler programs

CICS supports several types of JSON pipelines, for more information, see CICS as a service provider for JSON requests. Two configurations are suitable for use with locally optimized invoke functions from Node.js applications. These are referred to as CICS Java pipelines, and the CICS-supplied terminal handler DFHPIJT. JSON infrastructure that is implemented using z/OS® Connect for CICS, or the JAX-RS and JSON features of a CICS Liberty JVM server, are not eligible to be used. The DFHPIJT terminal handler (also referred to as the non-Java JSON service provider) is likely to offer the best performance characteristics for Node.js. Neither of these options support programmatically selecting the user and transaction IDs for target work within a handler program, also known as context switching. For information on customizing the user ID and the transaction ID, see Security for Node.js applications.

It is possible to write pipeline handler programs that detect that they are being called on behalf of a locally optimized invoke function from a Node.js application. Any such handler program can make programmatic decisions about the processing of the request. For example, it might reject work that arrives from Node.js applications, or branch around logic that is only relevant to work that arrives over HTTP. A control container that is called DFHWS-NODEJSAPP is populated by CICS on the current channel, the content of which names the NODEJSAPP resource from which the work has originated. Handler programs, and channel attached applications, can query this container.