Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 8 Routing : Preferred Routing

Preferred Routing
TIBCO API Exchange Gateway supports routing of the client request based on preferred routing key. To use preferred routing, specify a preferred routing key for a partner operation as a facade access.
TIBCO API Exchange Gateway processes a facade operation request from the partner for preferred routing, as follows:
If the Preferred Routing Key is not blank, preferred routing is enabled and the Core Engine uses this value as the routing key. Make sure to configure the a routing key which matches the preferred routing key.
If the Preferred Routing Key is blank, the Core Engine does not enable preferred routing.
If the preferred routing key is not configured on the Routing tab, the default routing key is used.
If the default routing key is not configured, an error such as Route not found for transaction ID transaction_ID is returned.
Use Case for Preferred Routing
TIBCO API Exchange Gateway supports the plan type for preferred routing. When the plan type is passed from the TIBCO API Exchange Manager to TIBCO API Exchange Gateway, the Core Engine populates the plan type in the Preferred Routing Key field of the Facade Access tab on the Config UI of TIBCO API Exchange Gateway.
Refer to TIBCO API Exchange Manager Administration on how to configure a plan type.
Example
If you selected the Gold plan type in TIBCO API Exchange Manager for the getLocationBW facade operation, use the following configuration to route the getLocationBW facade operation request to the http.getLocation target operation:
1.
2.
3.
4.
On the ROUTING tab, click Routing on the top menu.
5.
Click Add Property to add a new routing configuration.
6.
Select getLocationBW from the drop-down list.
Select Target Operation from the drop-down list.
The routing key must match the value populated in the Preferred Routing Key field of the Facade Access tab as the routing key.
Select the target operation as http.getLocation from the drop-down list. The http.getLocation target operation is defined in the Target Operations tab.
7.
If the preferred routing key is not configured as the routing key in the Routing tab of Config UI, the default routing key is used.
You can change the value of the preferred routing key using the XSLT file. The XSLT file is uploaded in the New ProcessBody Transform field of the facade operation to derive the routing key. The routing key derived from the XSLT file takes the precedence over the routing key configured as preferred routing in the Routing tab of Config UI. See Override Preferred Routing Key using XSLT for details.
Override Preferred Routing Key using XSLT
To change the value of the preferred routing key using the XSLT file, follow these steps:
1.
2.
3.
4.
On the ROUTING tab, click Routing on the top menu.
5.
Select the Facade Operations tab.
6.
In the New ProcessBody Transform field, upload the XSLT file. The XSLT file generates the routing key using the <routingKey> tag. See Example XSLT File.
7.
Example XSLT File
The following is an example of an XSLT file that sets the routing key as SILVER. Set any value for the routing key in the XSLT file to overwrite the Preferred Routing Key value specified in the Facade Access tab.

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:c="http://www.tibco.com/schemas/asg/context"
xmlns:h="http://www.tibco.com/asg/protocols/http"
exclude-result-prefixes="xsl fn h c">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/>
<xsl:variable name="contextHref">
<xsl:value-of select="/transformation/context/@href"/>
</xsl:variable>
 
<xsl:variable name="httpRequest">
<xsl:copy-of select="document($contextHref)/c:context/c:entry[@key='asg:httpRequest']/h:request"/>
</xsl:variable>
 
<xsl:template match="/">
<output>
<routingKey>SILVER</routingKey>
</output>
</xsl:template>
 
</xsl:stylesheet>

 

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved