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


Chapter 8 Routing : Target Operation Group Configuration

Target Operation Group Configuration
This section explains the configuration setup for a target operation group to select a routing algorithm. The routing algorithm determines the target operation within the target operation group to process the facade request received by this target operation group.
Configure a Target Operation Group
To configure a target operation group, follow these steps:
1.
Ensure that you are on the Routing tab of the Config UI. See Click the ROUTING Tab.
2.
Click the Target Operation Groups tab on the top menu.
3.
4.
Configure a RoundRobin Target Operation Group
To configure a target operation group of RoundRobin type, select the type of target operation group as RoundRobin. Follow these steps:
1.
Click the Target Operation Groups tab.
2.
Select RoundRobin from the drop-down list. See RoundRobin Target Operation Group Configuration.
3.
4.
Figure RoundRobin Target Operation Group Configuration shows the RoundRobin Target Operation Group configuration.
Figure 13 RoundRobin Target Operation Group Configuration
Configure a WeightedRoundRobin Target Operation Group
To configure a target operation group of WeightedRoundRobin type, select the type of the target operation group as WeightedRoundRobin. Follow these steps:
1.
Click the Target Operation Groups tab.
2.
Select WeightedRoundRobin from the drop-down list. See WeightedRoundRobin Target Operation Group Configuration.
3.
4.
Figure WeightedRoundRobin Target Operation Group Configuration shows the RoundRobin Target Operation Group configuration.
Figure 14 WeightedRoundRobin Target Operation Group Configuration
Configure a RoundRobinWithFailOver Target Operation Group
To configure a target operation group of RoundRobinWithFailover type, select the type of the target operation group as RoundRobinWithFailover. Follow these steps:
1.
Click the Target Operation Groups tab.
2.
Select RoundRobinWithFailover from the drop-down list. See RoundRobinWithFailOver Target Operation Group.
3.
4.
Figure RoundRobinWithFailOver Target Operation Group shows the RoundRobinWithFailover Target Operation Group configuration:
Figure 15 RoundRobinWithFailOver Target Operation Group
Configure a WeightedRoundRobinWithFailOver Target Operation Group
To configure a target operation group of WeightedRoundRobinWithFailover type, select the type of the target operation group as WeightedRoundRobinWithFailover. Follow these steps:
1.
Click the Target Operation Groups tab.
2.
3.
4.
Figure WeightedRoundRobinWithFailOver Target Operation Group shows the RoundRobinWithFailover Target Operation Group configuration:
Figure 16 WeightedRoundRobinWithFailOver Target Operation Group
StickyResourceAffinity Target Operation Group Configuration
This section explains the steps required to configure the target operation group of StickyResourceAffinity type:
 
Task A Define Sticky Routing Key
The sticky routing key can be defined based on many parameters such as the IP address, machine domain name, and so on. The StickyKey is populated from the <stickyRoutingKey> element tag in the transformation (XSLT) file.
Refer to Example XSLT File for StickyRoutingKey to define an XSLT file for the sticky routing key.
Example XSLT File for StickyRoutingKey
The following example illustrates an XSLT file to derive a StickyRouting Key. Refer to the <stickyRoutingKey> element tag in the file defined as follows:

 
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:c="http://www.tibco.com/schemas/asg/context"
xmlns:h="http://www.tibco.com/asg/protocols/http"
xmlns:f="http://www.tibco.com/asg/functions/form"
xmlns:form="http://www.tibco.com/asg/content-types/form"
xmlns:book="http://www.example.com/xsd/books"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
 
<xsl:output
omit-xml-declaration="yes"
indent="yes"
/>
 
<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:variable name="parsedQueryString">
<xsl:value-of select="$httpRequest/h:client-ip"/>
</xsl:variable>
 
<xsl:variable name="nbRequestHref">
<xsl:value-of select="/transformation/nbRequest/@href"/>
</xsl:variable>
<xsl:variable name="nbRequest">
<xsl:copy-of select="document($nbRequestHref)/soapenv:Envelope/soapenv:Body/*"/>
</xsl:variable>
 
<xsl:template match="/">
<output>
<xsl:variable name="username">
<xsl:value-of select="$nbRequest/book:Author"/>
</xsl:variable>
<username><xsl:value-of select="$username"/></username>
<parsedQueryString><xsl:value-of select="$parsedQueryString"/></parsedQueryString>
<routingKey>
<xsl:choose>
<xsl:when test="$username = 'Vivek Ranadive'"><xsl:value-of select="$username"/></xsl:when>
<xsl:when test="$username = 'Vivek Ranadive1'"><xsl:value-of select="$username"/></xsl:when>
<xsl:when test="$username = 'Vivek Ranadive3'"><xsl:value-of select="$username"/></xsl:when>
<xsl:otherwise>default</xsl:otherwise>
</xsl:choose>
</routingKey>
<stickyRoutingKey>
<xsl:choose>
<xsl:when test="$parsedQueryString != ''"><xsl:value-of select="$parsedQueryString"/></xsl:when>
<xsl:otherwise>default</xsl:otherwise>
</xsl:choose>
</stickyRoutingKey>
 
</output>
</xsl:template>
 
</xsl:stylesheet>

 
Task B Upload Sticky Routing Key File
To upload the XSLT file containing the <stickyRoutingKey> element, follow these steps:
1.
2.
3.
4.
Click the ROUTING tab on the right-hand side.
5.
Click the Facade Operations tab on the top menu.
6.
7.
a.
Click Choose File button in the New ProcessBody Transform field to select the XSLT transformation file containing stickyRoutingKey tag.
b.
Click Open on the new dialog to upload the file.
c.
If the XSLT file is located in the ASG_CONFIG_HOME/ASGConfigName/xslt/operations directory, choose the XSLT file in the ProcessBody Transform field.
8.
Task C Configure StickyResourceAffinity Type Target Operation Group
To configure a target operation group of StickyResourceAffinity type, select the type of the target operation group as StickyResourceAffinity. Follow these steps:
1.
Click the Target Operation Groups tab.
2.
Select StickyResourceAffinity from the drop-down list. See StickyResourceAffinity Target Operation Group Configuration for details.
3.
The following figure shows the StickyResourceAffinity Target Operation Group configuration:
Figure 17 StickyResourceAffinity Target Operation Group Configuration

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