Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2013-05-09T14:28:37Z by HisNibs
Chris.Z
Chris.Z
52 Posts
ACCEPTED ANSWER

Pinned topic How to respond to a health check

‏2013-05-03T13:13:17Z |

So I am wanting to send a health check request to each interface.  In each of our domains we have an MPG that listens for traffic on a URL, then passes that request to the appropriate WSP that is subscribed to a WSDL(normally through WSRR).  I would like to create a rule inside the WSP that says "if it's from this address, respond successful with out checking anything on the backend".  I've been googling and messing with this for a couple days.  Anyone have any tips?

  • Chris.Z
    Chris.Z
    52 Posts
    ACCEPTED ANSWER

    Re: How to respond to a health check

    ‏2013-05-06T14:06:03Z  in response to Chris.Z

     

    For anyone who sees this in the future.  We are using this code, and it seems to work for what we want to do.  Create this as .xsl, and make a transformation in your request rule.
    
    <xsl:template match="/">
      <xsl:variable name="X-clientIP" select="dp:request-header('X-Client-IP')"/> 
      <xsl:variable name="clientIP" select="substring-before($X-clientIP,',')"/>
       <xsl:if test="$clientIP='*EnterIP Here*' or $clientIP='
    *EnterIP Here*
    '">
         <dp:reject override="true">Successful health check</dp:reject> 
       </xsl:if>  
     <xsl:copy-of select="."/> 
     </xsl:template>
    
    • HisNibs
      HisNibs
      84 Posts
      ACCEPTED ANSWER

      Re: How to respond to a health check

      ‏2013-05-09T14:28:37Z  in response to Chris.Z

      Simpler way would be to add a set variable action on a ruleset and set it to service/skip-backside = 1, making sure the match rule is set to the address you want the HC to respond against

      Then run a simple XFORM to send back a formatted message of your choice

      Updated on 2013-05-09T14:29:28Z at 2013-05-09T14:29:28Z by HisNibs