Thanks for that Marco and JayMac.
I started to use pre-service policy and that seems okay. but now that I can perform something before the service resolves.. How to extract a variable from the Global Pre-Service Fragment to use it in the actual service? is there any way?
Because, wanted to use the variables in the Service that are set in the Global Pre-Service Policy. ***** Have used Export Variables from Fragment and checked the required variable to export, but no luck ****
Please advice. Thanks. ~PS.
Original Message:
Sent: 01-08-2021 02:15 PM
From: Jay MacDonald
Subject: How to add a Global Policy to execute every time when every service is resolved?
You probably want to use a pre-service global policy for this. A pre-service policy is executed immediately prior to the service policy itself.
As described in the documentation:
- message-received is run for EVERY request that arrives at the Gateway
- pre-security is run during service resolution. As a point of clarification, the pre-security and post-security global policies tend to confuse the global policy configuration a bit and I don't use it. They only make sense in the context of a SOAP service that uses WS-* and dynamic service resolution (i.e. the request was routed to /ssg/soap).
- pre-service is run immediately prior to executing the service policy
- post-service is run immediately after the service policy *assuming the service policy did not fail
- post-security is run AFTER and WS-* security is performed on the SOAP response message (assuming the service policy did not fail), and like pre-security I never use it.
- message-complete is executed for all messages received
------------------------------
Jay MacDonald - Adoption Architect - Broadcom API Management (Layer 7)
Original Message:
Sent: 01-06-2021 04:44 AM
From: Pavansai C
Subject: How to add a Global Policy to execute every time when every service is resolved?
Global Policy Fragments
Broadcom |
remove preview |
|
Global Policy Fragments |
Global policies are policy fragments that are always applied before or after every service policy in the system. They can be used to configure global behaviors like auditing or logging, where it may not be feasible to manually add the policy logic to all service policies. |
View this on Broadcom > |
|
|
Hi There,
We are using API Gateway v9.4
We have a Policy Fragment and we're thinking to make it global such that whenever a service is resolved this policy also should be executed along and this should be done for all the services that are hosted in the API Gateway.
Have gone through the below techdoc, but not sure which one among these can be used for the same.
https://techdocs.broadcom.com/us/en/ca-enterprise-software/layer7-api-management/api-gateway/9-4/services-and-policies/working-with-policies/policy-fragments/global-policy-fragments.html
Can someone please suggest how this can be achieved?
Thanks in advance.
PS