Define a Transformation File

Define a transformation (XSLT) file that contains the routingKey element tag to populate the routing key.

See the following references:

Routing Schema document

Note: The following elements are available as input for the transformations and can be used to derive the routing key:
  • facade operation request content (as defined by nbRequest element).
  • facade operation request context (as defined by context element).

In the request processing pipeline of a facade operation request, the input document to the XSLT file for parsing the facade request is defined by the following schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<xs:element name="transformation" type="transformationType"/>
<xs:complexType name="transformationType">
<xs:sequence>
<xs:element name="nbRequest" type="stageType" minOccurs="0"/>
<xs:element name="cnRequest" type="stageType" minOccurs="0"/>
<xs:element name="sbRequest" type="stageType" minOccurs="0"
maxOccurs="unbounded"/>
<xs:element name="sbResponse" type="stageType" minOccurs="0"
maxOccurs="unbounded"/>
<xs:element name="cnResponse" type="stageType" minOccurs="0"/>
<xs:element name="nbResponse" type="stageType" minOccurs="0"/>
<xs:element name="context" type="stageType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="stageType">
<xs:attribute name="href" type="xs:string"/>
</xs:complexType>
</xs:schema>

Example XSLT File to Derive Routing Key

Refer to the following transformation (XSLT) file shipped with the GetLocation example:

  • ASG_CONFIG_HOME/GetLocation/xslt/operations/parse_getLocation.xml

    The example illustrates that the routing key is populated based on the value of opCoId, which is derived as a substring of the address element in the request message.

    <routingKey>
        <xsl:choose>
          <xsl:when test="$opCoId != ''"><xsl:value-of        select="$opCoId"/></xsl:when>
          <xsl:otherwise>undefined</xsl:otherwise>
        </xsl:choose>
      </routingKey>