Monday, August 25, 2014

Gotcha: 2 Preflow Tags

Proxy or Target XML file can contain multiple PreFlow tags. Though XML allows it syntactically - semantically this does not work as expected. The validation is currently missing.

 <PreFlow>
        <Request>
            <Step>
                <Name>assign_client_id</Name>
            </Step>
        </Request>
    </PreFlow>
    <PreFlow>
        <Request>
            <Step>
                <Name>assign_referrer_id</Name>
            </Step>
        </Request>
 </PreFlow>

In case of multiple PreFlow tags, only the policies in the last (textually last) PreFlow tag is executed. The policies in other PreFlow tags are silently ignored. Deployment and runtime validation are missing for this error. In the example above - only assign_referrer_id policy will be executed.

Monday, August 18, 2014

Handling for CLASSIFICATION_FAILURE (404 Handling)

One of the production checklist items while setting up Apigee for production is handling a invalid API call.  The call typically results in CLASSIFICATION_FAILURE error.  This is a stackoverflow question related to issue.

Its always best to have a catch all URL in production environment of Apigee.  You can create brand new proxy with a base path  / . This proxy can have a single flow that returns the custom message using an assign message policy. This catch all proxy is like a custom 404 handler in web-servers.