SlideShare a Scribd company logo
Custom Policies in Mule
4 and a Circuit Breaker
Example
SUSMIT D EY
MULESOFT ARCHITECT
Agenda
• Introduction
• Policy Architecture
• Autodiscovery Revisit
• Resource LevelPolicies
• CustomPolicies
• Setup
• Package & Deploy
• Flow Execution
• YAML Configurations
• InboundandOutboundPolicies
• CustomCircuit Breaker Policy - Demo
• CustomSalesforceOAuth InjectorPolicy - Demo
Introduction
• Policies are extended functionalities which you can apply on your API instances using API Manager.
• API instances are instances of Mule applications defined in API Manager which are paired with the deployed
application in the runtime manager using Auto-Discovery.
• Alternatively, an offline custom policy is applied directly to the runtime and not through API Manager.
• API policies are layered on the top of the API implementation to provide governance, security or visibility.
• Majority of use cases are covered by default OOTB policies provided by MuleSoft:
• Client ID Enforcement
• Basic Authentication– Simple Policy
• Basic Authentication- LDAP
• IP Blacklist
• IP Whitelist
• Spike Control
• Rate Limiting
• Rate Limitingwith SLAetc.
Policy Architecture
• MisconceptionthatAPI Manager interceptsrequeststo your API, it doesn’t.
• API Instancesdefined in API Manager gets paired with the APIs deployed in the Mule Environmentvia
Auto-Discovery.
• A communicationagentwithin the Runtime manager checks any update in the API Managerand
downloads and applies the policies on the top of the API instances.
• Below applicationproperties allow pairing of API with the Mule application:
anypoint.platform.analytics_base_uri=https://analytics-ingest.anypoint.mulesoft.com
anypoint.platform.coreservice_base_uri=https://anypoint.mulesoft.com/accounts
anypoint.platform.platform_base_uri=https://anypoint.mulesoft.com/apiplatform
anypoint.platform.contracts_base_uri=https://anypoint.mulesoft.com/apigateway/ccs
anypoint.platform.client_id=<environment_client_id>
anypoint.platform.client_secret=<environment_client_secret>
Policy Architecture
Autodiscovery Revisit
• API Autodiscovery is used to pair an API in API Manager to its deployed Mule application.
• Runtime manager agent enforcesthe policies on the API by communicatingwith the API Manager.
• GateKeeperprevents this trafficby blocking the trackedresource until all policies have been retrieved
and applied without errors.During this period, the API returnsa 503 HTTP statuscode.
<api-gateway:autodiscovery
apiId="${apiId}" flowRef="myFlow" />
• Configure the apiIdwith the API ID that API
Manager assigned to your API.
• Set the flowRefelement to point to the HTTP
flow that youwant to pair to the API in API
Manager.
Resource Level Policies
• In Mule 4, resource-level policies supportHTTP-based APIs in addition to RAML APIs.You can apply
multiple conditions to filter your resources and HTTP methods using the URI template regex to any
number of methods in your API.
Custom Policies
• Custom Policies are extended functionalitieswhich are developed as per specific requirements and are
applied to the Mule applicationin the same way as default policies provided by MuleSoft.
• In Mule 4 and later,policies are assets in Exchange. You have to go to Exchange,instead of API Manager,
to create policies. In Mule 3, custompolicies were createdin API manager by uploading the policy
artefacts.
Online Policy
• An online policy is applied to an API by the runtime manager by connectingto the API Manager.
Offline Policy
• An offline policy is applied directly to the runtime and not throughAPI Manager.
Custom Policies
Scenarios when custom policies can be useful:
• Custom policies can be used for implementing any non-functionalrequirement that is related to API
management and is not available as an OOTB policy in the API manager.
• Implementing a custompolicy helps the policy logic to be applied on multiple APIs via API manager
rather than implementing the logic in every API.
• Inbound policies can be used to manage incoming requests or trafficto an API for example throttling,
circuitbreaker, cachingor for implementing any customsecurity mechanism.
• Outbound policies can be used to inject customheaders or perform any house-keeping tasks before and
after any outboundHTTP request made in the Mule flow.
Custom Policies
• The current workflow to get a working policy for Mule 4 thatcan be applied in Anypoint Platform
consistsof:
• Developthe policy.
• Package the policy.
• Uploadthe resulting policy assets to Exchange.
• Apply the policy to any API through API Manager.
• A custompolicy consistof two main artefactspackagedintoa JAR:
• A Mule configurationfile containingthe policy logic.
• A YAML file describing the policy configurations to be done via API manager UI.
• Create the custompolicy projectusing the Mule archetyperepository:
• https://repository-master.mulesoft.org/nexus/content/repositories/public
Custom Policies - Setup
• Set up your maven settings- $M2_HOME/conf/settings.xmlto locate the archetype repository:
<profile>
<id>archetype-repository</id>
<repositories>
<repository>
<id>archetype</id>
<name>MuleRepository</name>
<url>https://repository-master.mulesoft.org/nexus/content/repositories/public</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
</repositories>
</profile>
Custom Policies - Setup
• Create a maven projectusing the archetyperepository:
• Enter the policy descriptionand policy name:
mvn -Parchetype-repository archetype:generate 
-DarchetypeGroupId=org.mule.tools 
-DarchetypeArtifactId=api-gateway-custom-policy-archetype 
-DarchetypeVersion=1.2.0 
-DgroupId=f2c80369-122e-2ea2-8362-464d7f1aa055 
-DartifactId=custom-circuit-breaker-policy 
-Dversion=1.0.0 
-Dpackage=mule-policy
• The groupId shouldbe the org id of the
organisationwhere the policy will be uploaded.
• Get the org id fromthe Access Management →
Organization.
Custom Policies - Setup
• Custom policy project structure:
• mule-artifact.json represents the descriptor for the custom policy application. Policies cannot export
resources nor packages such as Java classes.
• my-custom-policy.yaml renders the policy configuration UI. If this file is not provided, the policy won’t be able
to be applied through API Platform’s UI.
• template.xml where the actual logic of the policy and Mule configuration that defines the policy behaviour.
Custom Policies - Setup
• Import the maven projectin Anypoint Studio:
• File → Import → Maven→ ExistingMavenProjects → Browsethe root folder of the mavenproject whichgot generated → Click
Finish.
• The POM file of the projectwill containthe below segment,
• Mention the URL with the Org Id in the properties section in the POM file:
<distributionManagement>
<repository>
<id>exchange-server</id>
<name>Corporate Repository</name>
<url>${exchange.url}</url>
<layout>default</layout>
</repository>
</distributionManagement>
<exchange.url>https://maven.anypoint.mulesoft.com/api/v1/organizations/f2c80369-122e-2ea2-8362-
464d7f1aa055/maven</exchange.url>
• Add the Anypoint platformuserwhichhas rights to upload
artefactsinto Exchange,inthe server configurationin
Mavensettings. The <id> field shouldmatchthe name of
the <id> in distribution management in the POM file.
<server>
<id>exchange-server</id>
<username>myapuser</username>
<password>myappassword123</password>
</server>
Custom Policies – Package & Deploy
• Packagethe policy
• mvn package
• Deploy the policy into Exchange
• mvn deploy
Custom Policies – Inbound and
Outbound
• Policies can be applied to an HTTP flow as a source type or an operationtype.
• Sourcetype also called Inbound type is applicable to the HTTP Listener in the source of the HTTP flow.
• Operationtype also called Outbound type are applicable on each HTTP Requester in the HTTP Flow.
• To disable anoutbound policy for a specific HTTP requester,addthe below annotationotherwise the policy is applicable to all the
HTTP requesters in the flow,this feature is releasedfor Mule runtime version4.3.0 :
• api-gateway:disablePolicies=“true”
• A Sample Inbound
policy
Custom Policies – YAML
id: circuit-breaker-policy
name: circuit-breaker-policy
description: A Circuit Breaker
category: Custom
type: custom
resourceLevelSupported: true
encryptionSupported: false
standalone: true
configuration:
- propertyName: tripThreshold
name: Trip Threshold
description: Maximum number of errors allowed before the circuit is open.
type: int
minimumValue: 1
maximumValue: 2147483647
optional: false
sensitive: false
allowMultiple: false
- propertyName: errorCodes
name: Error Codes
description: A comma separated list of error codes for which the circuit breaker criteria is evaluated.
type: string
optional: false
sensitive: false
allowMultiple: false
• A YAML ConfigurationFile contains the policy
parameters andmetadata.
Custom Policies – YAML Property Types
• The ConfigurationUI properties are accessible in the policy templateusing Handlebar variables.
• Handlebar expressionssupport different constructslike if-else, each (for multiple values/keyvalue lists) etc.
• https://handlebarsjs.com/guide/builtin-helpers.html
• Depending of the type of the parameter,the UI will render a different type of input such as::
• String: Any string expected.
• Expression: A DataWeaveexpression starting with #[ and finished with ] is expected.
• Boolean: true or false.
• Int: A number is expected. This type requires additional properties.
• minimumValue: -1
• maximumValue: 2147483647
• Radio: One valueof a group of options. This type requires additional properties:
• Keyvalues: Collection of Key-Valuepairs. You can loop through all the Key-Valuepairs using handlebar #each construct.
• Ex - {{#each responseHeaders}}
<http-transform:header headerName="{{{this.key}}}" headerValue="{{{this.value}}}"/>
{{/each}}
Custom Policies – Extensions
• HTTP Policy TransformExtensionallows manipulation of HTTP request/responsemessages in the
custompolicies.
• Operationsallowed:
• Add Headers Operations
• Add Request Headers
• Add Request Headers List (Since mule-http-policy-transform-extension3.1.0)
• Add Response Headers
• Add Response Headers List (Since mule-http-policy-transform-extension3.1.0)
• Remove Headers
• Set Response
• Set Request
Ref: https://docs.mulesoft.com/api-manager/2.x/http-policy-transform
Custom Policies – Inbound and
Outbound
Source
Operation
HTTPFlow
HTTPListener
HTTPRequester
Mule Flow Steps
Mule Flow Steps
Execute next
Execute next
Pre-ExecutionSteps
Post-ExecutionSteps
Pre-ExecutionSteps
Post-ExecutionSteps
1
2
3
4
5
6
Custom Policies – Inbound and
Outbound
Source
Operation
HTTPFlow
HTTPListener
HTTPRequester
Mule Flow Steps
Mule Flow Steps
Execute next
Execute next
Pre-ExecutionSteps
Post-ExecutionSteps
Pre-ExecutionSteps
Post-ExecutionSteps
1
2
3
4
5
6 • Default
message
propagation
• Default
message
propagation
To achieve message
propagationin#1 and #5 use
property
propagateMessageTransforma
tions=true in the Source and
Operationelements
respectively
Custom Circuit Breaker - Demo
• This simple circuitbreakeravoids making the protected
call when the circuitis open, butwould needan
externalinterventiontoresetit when thingsare well
again.This is a reasonable approachwith electrical
circuitbreakersin buildings,but for softwarecircuit
breakerswe can have the breakeritself detectif the
underlyingcalls are working again.We can implement
this self-resettingbehaviourby trying the protectedcall
again aftera suitableinterval,andresettingthe
breaker shouldit succeed.
• Ref: https://martinfowler.com/bliki/CircuitBreaker.html
Custom Circuit Breaker - Demo
• GitHub Code Repository:
https://github.com/susmind/mule-circuit-
breaker-policy
◦ Clone the project and import in your
anypointstudio
◦ Modifypom.xml to inject your Org Id
◦ Configure your maven settings with the
AnypointExchange server credentials
◦ Deploythe policyusing maven command:
◦ mvn deploy
◦ Open Anypoint Exchange to verifythat the
custom policygot deployed.
◦ Go to API Manager API instance and apply
the policyby selectingthe category –
“Custom”
Custom Salesforce OAuth Injector Policy -
Demo
• GitHub Code Repository:
https://github.com/susmind/mule-circuit-breaker-policy
◦ This is an outbound policythat calls the Salesforce Login API,
stores,refreshes and injects OAuth Tokens for the outbound
Salesforce REST API calls in the HTTP flow on which the policy
is applied.
◦ This is implemented to demo an outboundpolicyand not
suggested to use this mechanism to interact with Salesforce
REST API in general.
◦ Use the steps mentioned in the previous slides to import the
policyproject in the Anypoint studio and use Maven to deploy
in the Exchange.
◦ Repositoryfor the sample API used in the Demo can be found
here: https://github.com/susmind/mule-meetup-sample-
api.git
Thank You

More Related Content

What's hot

Building APIs with Mule and Spring Boot
Building APIs with Mule and Spring BootBuilding APIs with Mule and Spring Boot
Building APIs with Mule and Spring Boot
Guilherme Pereira Silva
 
Introducing Anypoint Exchange 2.0
Introducing Anypoint Exchange 2.0Introducing Anypoint Exchange 2.0
Introducing Anypoint Exchange 2.0
MuleSoft
 
Rtf v2 ingress muleSoft meetup self managed kubernetes
Rtf v2 ingress muleSoft meetup self managed kubernetesRtf v2 ingress muleSoft meetup self managed kubernetes
Rtf v2 ingress muleSoft meetup self managed kubernetes
Sandeep Deshmukh
 
Logging best practice in mule using logger component
Logging best practice in mule using logger componentLogging best practice in mule using logger component
Logging best practice in mule using logger component
Govind Mulinti
 
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Eva Mave Ng
 
Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft
Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft
Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft
Akshata Sawant
 
MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...
MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...
MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...
Jitendra Bafna
 
MuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleysMuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleys
Angel Alberici
 
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
Jitendra Bafna
 
Learn More About Object Store | MuleSoft Mysore Meetup #9
Learn More About Object Store | MuleSoft Mysore Meetup #9Learn More About Object Store | MuleSoft Mysore Meetup #9
Learn More About Object Store | MuleSoft Mysore Meetup #9
MysoreMuleSoftMeetup
 
Best Practices for API Security
Best Practices for API SecurityBest Practices for API Security
Best Practices for API Security
MuleSoft
 
Demystifying the use of circuit breakers with MuleSoft
Demystifying the use of circuit breakers with MuleSoftDemystifying the use of circuit breakers with MuleSoft
Demystifying the use of circuit breakers with MuleSoft
Sandeep Deshmukh
 
MuleSoft Architecture Presentation
MuleSoft Architecture PresentationMuleSoft Architecture Presentation
MuleSoft Architecture Presentation
Rupesh Sinha
 
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Manish Kumar Yadav
 
Uncover the Flex Gateway with a Demonstration (1).pdf
Uncover the Flex Gateway with a Demonstration (1).pdfUncover the Flex Gateway with a Demonstration (1).pdf
Uncover the Flex Gateway with a Demonstration (1).pdf
Pankaj Goyal
 
Mule api management
Mule  api managementMule  api management
Mule api management
Bhanu Chandra Nalleboyina
 
Introduction to Mulesoft
Introduction to MulesoftIntroduction to Mulesoft
Introduction to Mulesoft
venkata20k
 
Best Practices in Implementing a Center for Enablement (C4E) within Your Orga...
Best Practices in Implementing a Center for Enablement (C4E) within Your Orga...Best Practices in Implementing a Center for Enablement (C4E) within Your Orga...
Best Practices in Implementing a Center for Enablement (C4E) within Your Orga...
MuleSoft
 
Cloudhub 2.0
Cloudhub 2.0Cloudhub 2.0
Cloudhub 2.0
Christopher Co
 
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
Jitendra Bafna
 

What's hot (20)

Building APIs with Mule and Spring Boot
Building APIs with Mule and Spring BootBuilding APIs with Mule and Spring Boot
Building APIs with Mule and Spring Boot
 
Introducing Anypoint Exchange 2.0
Introducing Anypoint Exchange 2.0Introducing Anypoint Exchange 2.0
Introducing Anypoint Exchange 2.0
 
Rtf v2 ingress muleSoft meetup self managed kubernetes
Rtf v2 ingress muleSoft meetup self managed kubernetesRtf v2 ingress muleSoft meetup self managed kubernetes
Rtf v2 ingress muleSoft meetup self managed kubernetes
 
Logging best practice in mule using logger component
Logging best practice in mule using logger componentLogging best practice in mule using logger component
Logging best practice in mule using logger component
 
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
 
Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft
Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft
Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft
 
MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...
MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...
MuleSoft Surat Meetup#42 - Runtime Fabric Manager on Self Managed Kubernetes ...
 
MuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleysMuleSoft Sizing Guidelines - VirtualMuleys
MuleSoft Sizing Guidelines - VirtualMuleys
 
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
 
Learn More About Object Store | MuleSoft Mysore Meetup #9
Learn More About Object Store | MuleSoft Mysore Meetup #9Learn More About Object Store | MuleSoft Mysore Meetup #9
Learn More About Object Store | MuleSoft Mysore Meetup #9
 
Best Practices for API Security
Best Practices for API SecurityBest Practices for API Security
Best Practices for API Security
 
Demystifying the use of circuit breakers with MuleSoft
Demystifying the use of circuit breakers with MuleSoftDemystifying the use of circuit breakers with MuleSoft
Demystifying the use of circuit breakers with MuleSoft
 
MuleSoft Architecture Presentation
MuleSoft Architecture PresentationMuleSoft Architecture Presentation
MuleSoft Architecture Presentation
 
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
 
Uncover the Flex Gateway with a Demonstration (1).pdf
Uncover the Flex Gateway with a Demonstration (1).pdfUncover the Flex Gateway with a Demonstration (1).pdf
Uncover the Flex Gateway with a Demonstration (1).pdf
 
Mule api management
Mule  api managementMule  api management
Mule api management
 
Introduction to Mulesoft
Introduction to MulesoftIntroduction to Mulesoft
Introduction to Mulesoft
 
Best Practices in Implementing a Center for Enablement (C4E) within Your Orga...
Best Practices in Implementing a Center for Enablement (C4E) within Your Orga...Best Practices in Implementing a Center for Enablement (C4E) within Your Orga...
Best Practices in Implementing a Center for Enablement (C4E) within Your Orga...
 
Cloudhub 2.0
Cloudhub 2.0Cloudhub 2.0
Cloudhub 2.0
 
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
 

Similar to Custom policies in mule 4 and a circuit breaker example

How to Secure Mule API's With a Demo
How to Secure Mule API's With a DemoHow to Secure Mule API's With a Demo
How to Secure Mule API's With a Demo
ManjuKumara GH
 
Warsaw MuleSoft Meetup #7 - custom policy
Warsaw MuleSoft Meetup #7 - custom policyWarsaw MuleSoft Meetup #7 - custom policy
Warsaw MuleSoft Meetup #7 - custom policy
Patryk Bandurski
 
Mule soft riyadh virtual meetup_30_aug
Mule soft riyadh virtual meetup_30_augMule soft riyadh virtual meetup_30_aug
Mule soft riyadh virtual meetup_30_aug
satyasekhar123
 
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
MysoreMuleSoftMeetup
 
MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...
MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...
MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...
Jitendra Bafna
 
[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...
[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...
[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...
jorgelebrato
 
Custom policies columbus ohio mulesoft meetup
Custom policies columbus ohio mulesoft meetupCustom policies columbus ohio mulesoft meetup
Custom policies columbus ohio mulesoft meetup
MuleSoft Meetup
 
Extend soa with api management spoug- Madrid
Extend soa with api management   spoug- MadridExtend soa with api management   spoug- Madrid
Extend soa with api management spoug- Madrid
Vinay Kumar
 
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
Jitendra Bafna
 
Extend soa with api management Doag18
Extend soa with api management Doag18Extend soa with api management Doag18
Extend soa with api management Doag18
Vinay Kumar
 
Deployment Download and Policy Workstream Update - Gábor Pécsy, Nokia
Deployment Download and Policy Workstream Update - Gábor Pécsy, NokiaDeployment Download and Policy Workstream Update - Gábor Pécsy, Nokia
Deployment Download and Policy Workstream Update - Gábor Pécsy, Nokia
mfrancis
 
Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10
D.Rajesh Kumar
 
ASM Course Content.pdf
ASM Course Content.pdfASM Course Content.pdf
ASM Course Content.pdf
viditsir
 
Azure API Manegement Introduction and Integeration with BizTalk
Azure API Manegement Introduction and Integeration with BizTalkAzure API Manegement Introduction and Integeration with BizTalk
Azure API Manegement Introduction and Integeration with BizTalk
Shailesh Dwivedi
 
apidays LIVE Hong Kong 2021 - Headless API Management by Snehal Chakraborty, ...
apidays LIVE Hong Kong 2021 - Headless API Management by Snehal Chakraborty, ...apidays LIVE Hong Kong 2021 - Headless API Management by Snehal Chakraborty, ...
apidays LIVE Hong Kong 2021 - Headless API Management by Snehal Chakraborty, ...
apidays
 
Hia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economyHia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economy
Andrew Coleman
 
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
MysoreMuleSoftMeetup
 
Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18
Mary Joy Sabal
 
Api manager
Api managerApi manager
Api manager
chaitanya581
 
Openfest15 MySQL Plugin Development
Openfest15 MySQL Plugin DevelopmentOpenfest15 MySQL Plugin Development
Openfest15 MySQL Plugin Development
Georgi Kodinov
 

Similar to Custom policies in mule 4 and a circuit breaker example (20)

How to Secure Mule API's With a Demo
How to Secure Mule API's With a DemoHow to Secure Mule API's With a Demo
How to Secure Mule API's With a Demo
 
Warsaw MuleSoft Meetup #7 - custom policy
Warsaw MuleSoft Meetup #7 - custom policyWarsaw MuleSoft Meetup #7 - custom policy
Warsaw MuleSoft Meetup #7 - custom policy
 
Mule soft riyadh virtual meetup_30_aug
Mule soft riyadh virtual meetup_30_augMule soft riyadh virtual meetup_30_aug
Mule soft riyadh virtual meetup_30_aug
 
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
Handling NFRs for the API through API policies (Custom Policies) -Part 2 | Mu...
 
MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...
MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...
MuleSoft Surat Virtual Meetup#3 - Anypoint Custom Policies, API Manager (Prox...
 
[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...
[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...
[Madrid-Meetup Octubre 22] Seguridad fuerte como el vinagre de Jerez. Políti...
 
Custom policies columbus ohio mulesoft meetup
Custom policies columbus ohio mulesoft meetupCustom policies columbus ohio mulesoft meetup
Custom policies columbus ohio mulesoft meetup
 
Extend soa with api management spoug- Madrid
Extend soa with api management   spoug- MadridExtend soa with api management   spoug- Madrid
Extend soa with api management spoug- Madrid
 
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
Engineering Student MuleSoft Meetup#3 - API Implementation using APIKIT route...
 
Extend soa with api management Doag18
Extend soa with api management Doag18Extend soa with api management Doag18
Extend soa with api management Doag18
 
Deployment Download and Policy Workstream Update - Gábor Pécsy, Nokia
Deployment Download and Policy Workstream Update - Gábor Pécsy, NokiaDeployment Download and Policy Workstream Update - Gábor Pécsy, Nokia
Deployment Download and Policy Workstream Update - Gábor Pécsy, Nokia
 
Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10Bangalore mulesoft meetup#10
Bangalore mulesoft meetup#10
 
ASM Course Content.pdf
ASM Course Content.pdfASM Course Content.pdf
ASM Course Content.pdf
 
Azure API Manegement Introduction and Integeration with BizTalk
Azure API Manegement Introduction and Integeration with BizTalkAzure API Manegement Introduction and Integeration with BizTalk
Azure API Manegement Introduction and Integeration with BizTalk
 
apidays LIVE Hong Kong 2021 - Headless API Management by Snehal Chakraborty, ...
apidays LIVE Hong Kong 2021 - Headless API Management by Snehal Chakraborty, ...apidays LIVE Hong Kong 2021 - Headless API Management by Snehal Chakraborty, ...
apidays LIVE Hong Kong 2021 - Headless API Management by Snehal Chakraborty, ...
 
Hia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economyHia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economy
 
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
Handling NFRs for the API through OoTB API policies Part-1 | MuleSoft Mysore ...
 
Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18Wellington MuleSoft Meetup 2021-02-18
Wellington MuleSoft Meetup 2021-02-18
 
Api manager
Api managerApi manager
Api manager
 
Openfest15 MySQL Plugin Development
Openfest15 MySQL Plugin DevelopmentOpenfest15 MySQL Plugin Development
Openfest15 MySQL Plugin Development
 

More from Royston Lobo

Singapore MuleSoft Meetup - 23 Nov 2022
Singapore MuleSoft Meetup - 23 Nov 2022Singapore MuleSoft Meetup - 23 Nov 2022
Singapore MuleSoft Meetup - 23 Nov 2022
Royston Lobo
 
Singapore MuleSoft Meetup - 24 Aug 2022
Singapore MuleSoft Meetup - 24 Aug 2022Singapore MuleSoft Meetup - 24 Aug 2022
Singapore MuleSoft Meetup - 24 Aug 2022
Royston Lobo
 
2022.06.23 - Sydney Meetup
2022.06.23 - Sydney Meetup2022.06.23 - Sydney Meetup
2022.06.23 - Sydney Meetup
Royston Lobo
 
MuleSoft Online Meetup - Salesforce Streaming APIs
MuleSoft Online Meetup - Salesforce Streaming APIsMuleSoft Online Meetup - Salesforce Streaming APIs
MuleSoft Online Meetup - Salesforce Streaming APIs
Royston Lobo
 
Online Meetup - MuleSoft - June 2020
 Online Meetup - MuleSoft - June 2020  Online Meetup - MuleSoft - June 2020
Online Meetup - MuleSoft - June 2020
Royston Lobo
 
MuleSOft PKO Developer meetup - 25 March 2021
MuleSOft PKO Developer meetup - 25 March 2021 MuleSOft PKO Developer meetup - 25 March 2021
MuleSOft PKO Developer meetup - 25 March 2021
Royston Lobo
 
Sydney MuleSoft Meetup #16 - 19 November 2020
Sydney MuleSoft Meetup #16 - 19 November 2020Sydney MuleSoft Meetup #16 - 19 November 2020
Sydney MuleSoft Meetup #16 - 19 November 2020
Royston Lobo
 
MuleSoft Online Meetup - MuleSoft integration with snowflake and kafka
MuleSoft Online Meetup - MuleSoft integration with snowflake and kafkaMuleSoft Online Meetup - MuleSoft integration with snowflake and kafka
MuleSoft Online Meetup - MuleSoft integration with snowflake and kafka
Royston Lobo
 
MuleSoft Online Meetup a Guide to RTF application deployment - October 2020
MuleSoft Online Meetup   a Guide to RTF application deployment  - October 2020MuleSoft Online Meetup   a Guide to RTF application deployment  - October 2020
MuleSoft Online Meetup a Guide to RTF application deployment - October 2020
Royston Lobo
 
Meetup 20200924 Sydney meetup
Meetup 20200924   Sydney meetupMeetup 20200924   Sydney meetup
Meetup 20200924 Sydney meetup
Royston Lobo
 
MuleSoft Online meetup - An expert's guide to Runtime fabric - August 2020
MuleSoft Online meetup -  An expert's guide to Runtime fabric - August 2020MuleSoft Online meetup -  An expert's guide to Runtime fabric - August 2020
MuleSoft Online meetup - An expert's guide to Runtime fabric - August 2020
Royston Lobo
 
Sydney mule soft meetup 30 april 2020
Sydney mule soft meetup   30 april 2020Sydney mule soft meetup   30 april 2020
Sydney mule soft meetup 30 april 2020
Royston Lobo
 
Creating an OData-Enabled API
Creating an OData-Enabled APICreating an OData-Enabled API
Creating an OData-Enabled API
Royston Lobo
 
Sydney MuleSoft Meetup #12 2020204
Sydney MuleSoft Meetup #12 2020204Sydney MuleSoft Meetup #12 2020204
Sydney MuleSoft Meetup #12 2020204
Royston Lobo
 
Sydney MuleSoft meetup #11 28 November 2019 - all slides
Sydney MuleSoft meetup #11   28 November 2019 - all slidesSydney MuleSoft meetup #11   28 November 2019 - all slides
Sydney MuleSoft meetup #11 28 November 2019 - all slides
Royston Lobo
 
Sydney mule soft meetup #8 1 August 2019 - all slides
Sydney mule soft meetup #8   1 August 2019 - all slidesSydney mule soft meetup #8   1 August 2019 - all slides
Sydney mule soft meetup #8 1 August 2019 - all slides
Royston Lobo
 

More from Royston Lobo (16)

Singapore MuleSoft Meetup - 23 Nov 2022
Singapore MuleSoft Meetup - 23 Nov 2022Singapore MuleSoft Meetup - 23 Nov 2022
Singapore MuleSoft Meetup - 23 Nov 2022
 
Singapore MuleSoft Meetup - 24 Aug 2022
Singapore MuleSoft Meetup - 24 Aug 2022Singapore MuleSoft Meetup - 24 Aug 2022
Singapore MuleSoft Meetup - 24 Aug 2022
 
2022.06.23 - Sydney Meetup
2022.06.23 - Sydney Meetup2022.06.23 - Sydney Meetup
2022.06.23 - Sydney Meetup
 
MuleSoft Online Meetup - Salesforce Streaming APIs
MuleSoft Online Meetup - Salesforce Streaming APIsMuleSoft Online Meetup - Salesforce Streaming APIs
MuleSoft Online Meetup - Salesforce Streaming APIs
 
Online Meetup - MuleSoft - June 2020
 Online Meetup - MuleSoft - June 2020  Online Meetup - MuleSoft - June 2020
Online Meetup - MuleSoft - June 2020
 
MuleSOft PKO Developer meetup - 25 March 2021
MuleSOft PKO Developer meetup - 25 March 2021 MuleSOft PKO Developer meetup - 25 March 2021
MuleSOft PKO Developer meetup - 25 March 2021
 
Sydney MuleSoft Meetup #16 - 19 November 2020
Sydney MuleSoft Meetup #16 - 19 November 2020Sydney MuleSoft Meetup #16 - 19 November 2020
Sydney MuleSoft Meetup #16 - 19 November 2020
 
MuleSoft Online Meetup - MuleSoft integration with snowflake and kafka
MuleSoft Online Meetup - MuleSoft integration with snowflake and kafkaMuleSoft Online Meetup - MuleSoft integration with snowflake and kafka
MuleSoft Online Meetup - MuleSoft integration with snowflake and kafka
 
MuleSoft Online Meetup a Guide to RTF application deployment - October 2020
MuleSoft Online Meetup   a Guide to RTF application deployment  - October 2020MuleSoft Online Meetup   a Guide to RTF application deployment  - October 2020
MuleSoft Online Meetup a Guide to RTF application deployment - October 2020
 
Meetup 20200924 Sydney meetup
Meetup 20200924   Sydney meetupMeetup 20200924   Sydney meetup
Meetup 20200924 Sydney meetup
 
MuleSoft Online meetup - An expert's guide to Runtime fabric - August 2020
MuleSoft Online meetup -  An expert's guide to Runtime fabric - August 2020MuleSoft Online meetup -  An expert's guide to Runtime fabric - August 2020
MuleSoft Online meetup - An expert's guide to Runtime fabric - August 2020
 
Sydney mule soft meetup 30 april 2020
Sydney mule soft meetup   30 april 2020Sydney mule soft meetup   30 april 2020
Sydney mule soft meetup 30 april 2020
 
Creating an OData-Enabled API
Creating an OData-Enabled APICreating an OData-Enabled API
Creating an OData-Enabled API
 
Sydney MuleSoft Meetup #12 2020204
Sydney MuleSoft Meetup #12 2020204Sydney MuleSoft Meetup #12 2020204
Sydney MuleSoft Meetup #12 2020204
 
Sydney MuleSoft meetup #11 28 November 2019 - all slides
Sydney MuleSoft meetup #11   28 November 2019 - all slidesSydney MuleSoft meetup #11   28 November 2019 - all slides
Sydney MuleSoft meetup #11 28 November 2019 - all slides
 
Sydney mule soft meetup #8 1 August 2019 - all slides
Sydney mule soft meetup #8   1 August 2019 - all slidesSydney mule soft meetup #8   1 August 2019 - all slides
Sydney mule soft meetup #8 1 August 2019 - all slides
 

Recently uploaded

The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 

Recently uploaded (20)

The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 

Custom policies in mule 4 and a circuit breaker example

  • 1. Custom Policies in Mule 4 and a Circuit Breaker Example SUSMIT D EY MULESOFT ARCHITECT
  • 2. Agenda • Introduction • Policy Architecture • Autodiscovery Revisit • Resource LevelPolicies • CustomPolicies • Setup • Package & Deploy • Flow Execution • YAML Configurations • InboundandOutboundPolicies • CustomCircuit Breaker Policy - Demo • CustomSalesforceOAuth InjectorPolicy - Demo
  • 3. Introduction • Policies are extended functionalities which you can apply on your API instances using API Manager. • API instances are instances of Mule applications defined in API Manager which are paired with the deployed application in the runtime manager using Auto-Discovery. • Alternatively, an offline custom policy is applied directly to the runtime and not through API Manager. • API policies are layered on the top of the API implementation to provide governance, security or visibility. • Majority of use cases are covered by default OOTB policies provided by MuleSoft: • Client ID Enforcement • Basic Authentication– Simple Policy • Basic Authentication- LDAP • IP Blacklist • IP Whitelist • Spike Control • Rate Limiting • Rate Limitingwith SLAetc.
  • 4. Policy Architecture • MisconceptionthatAPI Manager interceptsrequeststo your API, it doesn’t. • API Instancesdefined in API Manager gets paired with the APIs deployed in the Mule Environmentvia Auto-Discovery. • A communicationagentwithin the Runtime manager checks any update in the API Managerand downloads and applies the policies on the top of the API instances. • Below applicationproperties allow pairing of API with the Mule application: anypoint.platform.analytics_base_uri=https://analytics-ingest.anypoint.mulesoft.com anypoint.platform.coreservice_base_uri=https://anypoint.mulesoft.com/accounts anypoint.platform.platform_base_uri=https://anypoint.mulesoft.com/apiplatform anypoint.platform.contracts_base_uri=https://anypoint.mulesoft.com/apigateway/ccs anypoint.platform.client_id=<environment_client_id> anypoint.platform.client_secret=<environment_client_secret>
  • 6. Autodiscovery Revisit • API Autodiscovery is used to pair an API in API Manager to its deployed Mule application. • Runtime manager agent enforcesthe policies on the API by communicatingwith the API Manager. • GateKeeperprevents this trafficby blocking the trackedresource until all policies have been retrieved and applied without errors.During this period, the API returnsa 503 HTTP statuscode. <api-gateway:autodiscovery apiId="${apiId}" flowRef="myFlow" /> • Configure the apiIdwith the API ID that API Manager assigned to your API. • Set the flowRefelement to point to the HTTP flow that youwant to pair to the API in API Manager.
  • 7. Resource Level Policies • In Mule 4, resource-level policies supportHTTP-based APIs in addition to RAML APIs.You can apply multiple conditions to filter your resources and HTTP methods using the URI template regex to any number of methods in your API.
  • 8. Custom Policies • Custom Policies are extended functionalitieswhich are developed as per specific requirements and are applied to the Mule applicationin the same way as default policies provided by MuleSoft. • In Mule 4 and later,policies are assets in Exchange. You have to go to Exchange,instead of API Manager, to create policies. In Mule 3, custompolicies were createdin API manager by uploading the policy artefacts. Online Policy • An online policy is applied to an API by the runtime manager by connectingto the API Manager. Offline Policy • An offline policy is applied directly to the runtime and not throughAPI Manager.
  • 9. Custom Policies Scenarios when custom policies can be useful: • Custom policies can be used for implementing any non-functionalrequirement that is related to API management and is not available as an OOTB policy in the API manager. • Implementing a custompolicy helps the policy logic to be applied on multiple APIs via API manager rather than implementing the logic in every API. • Inbound policies can be used to manage incoming requests or trafficto an API for example throttling, circuitbreaker, cachingor for implementing any customsecurity mechanism. • Outbound policies can be used to inject customheaders or perform any house-keeping tasks before and after any outboundHTTP request made in the Mule flow.
  • 10. Custom Policies • The current workflow to get a working policy for Mule 4 thatcan be applied in Anypoint Platform consistsof: • Developthe policy. • Package the policy. • Uploadthe resulting policy assets to Exchange. • Apply the policy to any API through API Manager. • A custompolicy consistof two main artefactspackagedintoa JAR: • A Mule configurationfile containingthe policy logic. • A YAML file describing the policy configurations to be done via API manager UI. • Create the custompolicy projectusing the Mule archetyperepository: • https://repository-master.mulesoft.org/nexus/content/repositories/public
  • 11. Custom Policies - Setup • Set up your maven settings- $M2_HOME/conf/settings.xmlto locate the archetype repository: <profile> <id>archetype-repository</id> <repositories> <repository> <id>archetype</id> <name>MuleRepository</name> <url>https://repository-master.mulesoft.org/nexus/content/repositories/public</url> <releases> <enabled>true</enabled> <checksumPolicy>fail</checksumPolicy> </releases> <snapshots> <enabled>true</enabled> <checksumPolicy>warn</checksumPolicy> </snapshots> </repository> </repositories> </profile>
  • 12. Custom Policies - Setup • Create a maven projectusing the archetyperepository: • Enter the policy descriptionand policy name: mvn -Parchetype-repository archetype:generate -DarchetypeGroupId=org.mule.tools -DarchetypeArtifactId=api-gateway-custom-policy-archetype -DarchetypeVersion=1.2.0 -DgroupId=f2c80369-122e-2ea2-8362-464d7f1aa055 -DartifactId=custom-circuit-breaker-policy -Dversion=1.0.0 -Dpackage=mule-policy • The groupId shouldbe the org id of the organisationwhere the policy will be uploaded. • Get the org id fromthe Access Management → Organization.
  • 13. Custom Policies - Setup • Custom policy project structure: • mule-artifact.json represents the descriptor for the custom policy application. Policies cannot export resources nor packages such as Java classes. • my-custom-policy.yaml renders the policy configuration UI. If this file is not provided, the policy won’t be able to be applied through API Platform’s UI. • template.xml where the actual logic of the policy and Mule configuration that defines the policy behaviour.
  • 14. Custom Policies - Setup • Import the maven projectin Anypoint Studio: • File → Import → Maven→ ExistingMavenProjects → Browsethe root folder of the mavenproject whichgot generated → Click Finish. • The POM file of the projectwill containthe below segment, • Mention the URL with the Org Id in the properties section in the POM file: <distributionManagement> <repository> <id>exchange-server</id> <name>Corporate Repository</name> <url>${exchange.url}</url> <layout>default</layout> </repository> </distributionManagement> <exchange.url>https://maven.anypoint.mulesoft.com/api/v1/organizations/f2c80369-122e-2ea2-8362- 464d7f1aa055/maven</exchange.url> • Add the Anypoint platformuserwhichhas rights to upload artefactsinto Exchange,inthe server configurationin Mavensettings. The <id> field shouldmatchthe name of the <id> in distribution management in the POM file. <server> <id>exchange-server</id> <username>myapuser</username> <password>myappassword123</password> </server>
  • 15. Custom Policies – Package & Deploy • Packagethe policy • mvn package • Deploy the policy into Exchange • mvn deploy
  • 16. Custom Policies – Inbound and Outbound • Policies can be applied to an HTTP flow as a source type or an operationtype. • Sourcetype also called Inbound type is applicable to the HTTP Listener in the source of the HTTP flow. • Operationtype also called Outbound type are applicable on each HTTP Requester in the HTTP Flow. • To disable anoutbound policy for a specific HTTP requester,addthe below annotationotherwise the policy is applicable to all the HTTP requesters in the flow,this feature is releasedfor Mule runtime version4.3.0 : • api-gateway:disablePolicies=“true” • A Sample Inbound policy
  • 17. Custom Policies – YAML id: circuit-breaker-policy name: circuit-breaker-policy description: A Circuit Breaker category: Custom type: custom resourceLevelSupported: true encryptionSupported: false standalone: true configuration: - propertyName: tripThreshold name: Trip Threshold description: Maximum number of errors allowed before the circuit is open. type: int minimumValue: 1 maximumValue: 2147483647 optional: false sensitive: false allowMultiple: false - propertyName: errorCodes name: Error Codes description: A comma separated list of error codes for which the circuit breaker criteria is evaluated. type: string optional: false sensitive: false allowMultiple: false • A YAML ConfigurationFile contains the policy parameters andmetadata.
  • 18. Custom Policies – YAML Property Types • The ConfigurationUI properties are accessible in the policy templateusing Handlebar variables. • Handlebar expressionssupport different constructslike if-else, each (for multiple values/keyvalue lists) etc. • https://handlebarsjs.com/guide/builtin-helpers.html • Depending of the type of the parameter,the UI will render a different type of input such as:: • String: Any string expected. • Expression: A DataWeaveexpression starting with #[ and finished with ] is expected. • Boolean: true or false. • Int: A number is expected. This type requires additional properties. • minimumValue: -1 • maximumValue: 2147483647 • Radio: One valueof a group of options. This type requires additional properties: • Keyvalues: Collection of Key-Valuepairs. You can loop through all the Key-Valuepairs using handlebar #each construct. • Ex - {{#each responseHeaders}} <http-transform:header headerName="{{{this.key}}}" headerValue="{{{this.value}}}"/> {{/each}}
  • 19. Custom Policies – Extensions • HTTP Policy TransformExtensionallows manipulation of HTTP request/responsemessages in the custompolicies. • Operationsallowed: • Add Headers Operations • Add Request Headers • Add Request Headers List (Since mule-http-policy-transform-extension3.1.0) • Add Response Headers • Add Response Headers List (Since mule-http-policy-transform-extension3.1.0) • Remove Headers • Set Response • Set Request Ref: https://docs.mulesoft.com/api-manager/2.x/http-policy-transform
  • 20. Custom Policies – Inbound and Outbound Source Operation HTTPFlow HTTPListener HTTPRequester Mule Flow Steps Mule Flow Steps Execute next Execute next Pre-ExecutionSteps Post-ExecutionSteps Pre-ExecutionSteps Post-ExecutionSteps 1 2 3 4 5 6
  • 21. Custom Policies – Inbound and Outbound Source Operation HTTPFlow HTTPListener HTTPRequester Mule Flow Steps Mule Flow Steps Execute next Execute next Pre-ExecutionSteps Post-ExecutionSteps Pre-ExecutionSteps Post-ExecutionSteps 1 2 3 4 5 6 • Default message propagation • Default message propagation To achieve message propagationin#1 and #5 use property propagateMessageTransforma tions=true in the Source and Operationelements respectively
  • 22. Custom Circuit Breaker - Demo • This simple circuitbreakeravoids making the protected call when the circuitis open, butwould needan externalinterventiontoresetit when thingsare well again.This is a reasonable approachwith electrical circuitbreakersin buildings,but for softwarecircuit breakerswe can have the breakeritself detectif the underlyingcalls are working again.We can implement this self-resettingbehaviourby trying the protectedcall again aftera suitableinterval,andresettingthe breaker shouldit succeed. • Ref: https://martinfowler.com/bliki/CircuitBreaker.html
  • 23. Custom Circuit Breaker - Demo • GitHub Code Repository: https://github.com/susmind/mule-circuit- breaker-policy ◦ Clone the project and import in your anypointstudio ◦ Modifypom.xml to inject your Org Id ◦ Configure your maven settings with the AnypointExchange server credentials ◦ Deploythe policyusing maven command: ◦ mvn deploy ◦ Open Anypoint Exchange to verifythat the custom policygot deployed. ◦ Go to API Manager API instance and apply the policyby selectingthe category – “Custom”
  • 24. Custom Salesforce OAuth Injector Policy - Demo • GitHub Code Repository: https://github.com/susmind/mule-circuit-breaker-policy ◦ This is an outbound policythat calls the Salesforce Login API, stores,refreshes and injects OAuth Tokens for the outbound Salesforce REST API calls in the HTTP flow on which the policy is applied. ◦ This is implemented to demo an outboundpolicyand not suggested to use this mechanism to interact with Salesforce REST API in general. ◦ Use the steps mentioned in the previous slides to import the policyproject in the Anypoint studio and use Maven to deploy in the Exchange. ◦ Repositoryfor the sample API used in the Demo can be found here: https://github.com/susmind/mule-meetup-sample- api.git