How to handle multiple proxy for exception handling in shared flow?

ajytwi
Participant III

Hi ,

I want to create common reusable component for exception handling with shared flow. This is working for one proxy i.e verify apikey with customized error message but I want to implement this for multiple proxy means if suppose error incurred in Verify API Key or spike arrest or quota than error message related to related policy has to get triggered with customizproxy-flow.zipshared-flow.ziped error message. I have created proxy and shared flow this is working for one policy but how to achieve this for multiple proxies.

Attaching code which is not working please let me know if I can do any changes on this.

Trying to achieve similar with these article but something I missed which I am not able to figure out.

https://community.apigee.com/questions/50358/fault-rule-in-shared-flow.html

Solved Solved
0 4 688
1 ACCEPTED SOLUTION

Hi @Ajay Tiwari,

Thanks for sharing proxy & shared flow bundle

1. I was able to reproduce the issue in my local org

2. For any kind of issue, best starting point to debug would be "trace tool"

3. After deploying your shared flow and proxy bundles, for my first test request, this is what i found in trace

6995-screen-shot-2018-06-07-at-44531-am.png

4. Though the shared flow was deployed, proxy was unable to find it!

5. It means there is an issue with your shared flow

6. I went back and looked at shared flow, switched between develop and overview tabs couple of times, and saw this error

6996-screen-shot-2018-06-07-at-44945-am.png

7. Checked the ConditionFlows in SharedFlow and noticed that there was no space between the OR operator and the next condition as shown below in the following lines

(fault.name  Matches "ApiKeyNotApproved") or 
            (fault.name Matches "CompanyStatusNotActive") or 
            (fault.name Matches "DeveloperStatusNotActive") or 
            (fault.name Matches "FailedToResolveAPIKey") or 
            (fault.name Matches "InvalidApiKey") or

8.Added the space after every OR operator, saved the changes and redeployed the Shared Flow. This resolved the issue.

Please make the above suggested changes and redeploy the Shared Flow.

Regards

Vidheer.

View solution in original post

4 REPLIES 4

Hi @Ajay Tiwari,

Thanks for sharing proxy & shared flow bundle

1. I was able to reproduce the issue in my local org

2. For any kind of issue, best starting point to debug would be "trace tool"

3. After deploying your shared flow and proxy bundles, for my first test request, this is what i found in trace

6995-screen-shot-2018-06-07-at-44531-am.png

4. Though the shared flow was deployed, proxy was unable to find it!

5. It means there is an issue with your shared flow

6. I went back and looked at shared flow, switched between develop and overview tabs couple of times, and saw this error

6996-screen-shot-2018-06-07-at-44945-am.png

7. Checked the ConditionFlows in SharedFlow and noticed that there was no space between the OR operator and the next condition as shown below in the following lines

(fault.name  Matches "ApiKeyNotApproved") or 
            (fault.name Matches "CompanyStatusNotActive") or 
            (fault.name Matches "DeveloperStatusNotActive") or 
            (fault.name Matches "FailedToResolveAPIKey") or 
            (fault.name Matches "InvalidApiKey") or

8.Added the space after every OR operator, saved the changes and redeployed the Shared Flow. This resolved the issue.

Please make the above suggested changes and redeploy the Shared Flow.

Regards

Vidheer.

Hi @vidheer

Thanks for your response.

After providing spaces I am able to call shared flow. Couple of things I have observed.

1) When I am calling http://********/error_handling_rhi url I am able to get expected response error response.

2) After Verify API key I have used quota policy to check whether this is working for other policies but when ever I am providing valid API key and once quota is exhausted shared flow should return customized error related to quota policy which I have set in shared flow assign message.

3) I want to have such a reusable component where whenever shared flow is called its respective error has to be shown to client. How to handle this situation.

Attaching respective documents.

Got the solution Error was with number format "429.02.001" changed this to 429 and issue solved thanks for your help .

Happy to help! cheers.