SlideShare a Scribd company logo
{
API GATEWAY SETUP
INTRODUCTION
The API Gateway runtime points to the backend APIs and services
that you define and abstracts them into a layer that the Anypoint
Platform manages. Consumer applications invoke your services.
APIs route to the endpoints that the gateway exposes to enforce
runtime policies and collect and track analytics data. The API
Gateway acts as a dedicated orchestration layer for all your backend
APIs to separate orchestration from implementation concerns. The
gateway leverages the governance capabilities of the API Manager,
so that you can apply throttling, security, and other policies to your
APIs.
Pre requisites
 AnypointStudio 3.6.0+
 Jdk 1.7
 APIKit
 Cloudhub account
 Process
 Here, I am going to create a POC (Addition of 2
numbers) in Mule (3.6), deploy the application
in Cloud and apply proxy for the same.
 Step 1
 POC (Addition of 2 numbers):
 Flow:
HTTP:
 SetPayload:
 .mflow
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:apikit="http://www.mulesoft.org/schema/mule/apikit"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/apikit
http://www.mulesoft.org/schema/mule/apikit/current/mule-apikit.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd" version="EE-3.5.2">
<apikit:config name="api-config" raml="api.raml" consoleEnabled="true"
consolePath="console" doc:name="Router"/>
<apikit:mapping-exception-strategy name="api-apiKitGlobalExceptionMapping"
doc:name="Mapping Exception Strategy">
<apikit:mapping statusCode="404">
<apikit:exception value="org.mule.module.apikit.exception.NotFoundException" />
<set-property propertyName="Content-Type" value="application/json"
doc:name="Property"/>
<set-payload value="{ &quot;message&quot;: &quot;Resource not found&quot; }"
doc:name="Set Payload"/>
</apikit:mapping>
<apikit:mapping statusCode="405">
<apikit:exception
value="org.mule.module.apikit.exception.MethodNotAllowedException" />
<set-property propertyName="Content-Type" value="application/json"
doc:name="Property"/>
<set-payload value="{ &quot;message&quot;: &quot;Method not allowed&quot; }"
doc:name="Set Payload"/>
</apikit:mapping>
<apikit:mapping statusCode="415">
<apikit:exception
value="org.mule.module.apikit.exception.UnsupportedMediaTypeException" />
<set-property propertyName="Content-Type" value="application/json"
doc:name="Property"/>
<set-payload value="{ &quot;message&quot;: &quot;Unsupported media type&quot;
}" doc:name="Set Payload"/>
</apikit:mapping>
<apikit:mapping statusCode="406">
<apikit:exception value="org.mule.module.apikit.exception.NotAcceptableException"
/>
<set-property propertyName="Content-Type" value="application/json"
doc:name="Property"/>
<set-payload value="{ &quot;message&quot;: &quot;Not acceptable&quot; }"
doc:name="Set Payload"/>
</apikit:mapping>
<apikit:mapping statusCode="400">
<apikit:exception value="org.mule.module.apikit.exception.BadRequestException" />
<set-property propertyName="Content-Type" value="application/json"
doc:name="Property"/>
<set-payload value="{ &quot;message&quot;: &quot;Bad request&quot; }"
doc:name="Set Payload"/>
</apikit:mapping>
</apikit:mapping-exception-strategy>
<flow name="api-main" doc:name="api-main">
<http:inbound-endpoint doc:name="HTTP" exchange-pattern="request-response"
host="localhost" path="add" port="8081"/>
<apikit:router config-ref="api-config" doc:name="APIkit Router"/>
<exception-strategy ref="api-apiKitGlobalExceptionMapping" doc:name="Reference
Exception Strategy"/>
</flow>
<flow name="get:/Addition/{num1}/{num2}:api-config"
doc:name="get:/Addition/{num1}/{num2}:api-config">
<set-payload
value="#[Integer.parseInt(flowVars['num1'])+Integer.parseInt(flowVars['num2'])]"
doc:name="Set Payload"/>
</flow>
</mule>
 api.raml:
#%RAML 0.8
---
title: Addition of two numbers
baseUri: http://addition-api/api
version: 1.0
/Addition/{num1}/{num2}:
displayName: Provide input Details here
get:
description: Enter input details
responses:
200:
body:
application/json:
 Step 2
 Deploy and test the above POC in cloud:
 Login to the anypoint.mulesoft.com (cloudhub).

https://anypoint.mulesoft.com/login/#/signin
 Go to Runtime Manager tab and deploy the above
POC.
 Click Deploy application tab, upload the zip file
(POC) and deploy the application.
 Provide application name, zip file, runtime version
and deploy the application.
 Test the application:
 Service URL:
 -> Get the service URL from the logs of above
deployed application.
 Open the above URL in browser and provide
the input details accordingly.
 Step 3
 How to apply proxy for the above
deployed application:
 Go to API Manager.
 Click Add new API tab.
 Provide the new API details.
 Provide the above created RAML file and
update the baseURL (get it from Step 2: C.1).
 Create new portal.
 Configure endpoint details.
 Request API access to get the new clientID and
client secret details.
 Apply clientID policy.
 Deploy the proxy.
 Get the proxy URL from the logs of above
deployed application.
 Test the deployed application.
 References
 https://docs.mulesoft.com/api-
manager/configuring-an-api-gateway

More Related Content

What's hot

Web Api vs MVC
Web Api vs MVCWeb Api vs MVC
ASP.NET MVC 4 - Routing Internals
ASP.NET MVC 4 - Routing InternalsASP.NET MVC 4 - Routing Internals
ASP.NET MVC 4 - Routing Internals
Lukasz Lysik
 
CakePHP REST Plugin
CakePHP REST PluginCakePHP REST Plugin
CakePHP REST Plugin
Kevin van Zonneveld
 
Splunk's api how we built it
Splunk's api   how we built itSplunk's api   how we built it
Splunk's api how we built it
Glenn Block
 
Spray - Build RESTfull services in scala
Spray - Build RESTfull services in scalaSpray - Build RESTfull services in scala
Spray - Build RESTfull services in scala
Sandeep Purohit
 
Advanced Durable Functions - Serverless Meetup Tokyo - Feb 2018
Advanced Durable Functions - Serverless Meetup Tokyo - Feb 2018Advanced Durable Functions - Serverless Meetup Tokyo - Feb 2018
Advanced Durable Functions - Serverless Meetup Tokyo - Feb 2018
Chris Gillum
 
Azure Durable Functions (2018-06-13)
Azure Durable Functions (2018-06-13)Azure Durable Functions (2018-06-13)
Azure Durable Functions (2018-06-13)
Paco de la Cruz
 
Slim Framework
Slim FrameworkSlim Framework
Slim Framework
Pramod Raghav
 
Web Deployment With Visual Studio 2010
Web Deployment With Visual Studio 2010Web Deployment With Visual Studio 2010
Web Deployment With Visual Studio 2010
Rishu Mehra
 
Grails plugin
Grails pluginGrails plugin
Grails plugin
Vijay Shukla
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
Antônio Roberto Silva
 
Building a Cloud API Server using Play(SCALA) & Riak
Building a Cloud API Server using  Play(SCALA) & Riak Building a Cloud API Server using  Play(SCALA) & Riak
Building a Cloud API Server using Play(SCALA) & Riak
RajthilakMCA
 
Asp.net identity 2.0
Asp.net identity 2.0Asp.net identity 2.0
Asp.net identity 2.0
Gelis Wu
 
PostgREST Design Philosophy
PostgREST Design PhilosophyPostgREST Design Philosophy
PostgREST Design Philosophy
begriffs
 
Very Brief Intro to Catalyst
Very Brief Intro to CatalystVery Brief Intro to Catalyst
Very Brief Intro to Catalyst
Zachary Blair
 
Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30) Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30)
Paco de la Cruz
 
Azure Durable Functions
Azure Durable FunctionsAzure Durable Functions
Azure Durable Functions
Karthikeyan VK
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)
Paco de la Cruz
 
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)
Paco de la Cruz
 
Node.js and Parse
Node.js and ParseNode.js and Parse
Node.js and Parse
Nicholas McClay
 

What's hot (20)

Web Api vs MVC
Web Api vs MVCWeb Api vs MVC
Web Api vs MVC
 
ASP.NET MVC 4 - Routing Internals
ASP.NET MVC 4 - Routing InternalsASP.NET MVC 4 - Routing Internals
ASP.NET MVC 4 - Routing Internals
 
CakePHP REST Plugin
CakePHP REST PluginCakePHP REST Plugin
CakePHP REST Plugin
 
Splunk's api how we built it
Splunk's api   how we built itSplunk's api   how we built it
Splunk's api how we built it
 
Spray - Build RESTfull services in scala
Spray - Build RESTfull services in scalaSpray - Build RESTfull services in scala
Spray - Build RESTfull services in scala
 
Advanced Durable Functions - Serverless Meetup Tokyo - Feb 2018
Advanced Durable Functions - Serverless Meetup Tokyo - Feb 2018Advanced Durable Functions - Serverless Meetup Tokyo - Feb 2018
Advanced Durable Functions - Serverless Meetup Tokyo - Feb 2018
 
Azure Durable Functions (2018-06-13)
Azure Durable Functions (2018-06-13)Azure Durable Functions (2018-06-13)
Azure Durable Functions (2018-06-13)
 
Slim Framework
Slim FrameworkSlim Framework
Slim Framework
 
Web Deployment With Visual Studio 2010
Web Deployment With Visual Studio 2010Web Deployment With Visual Studio 2010
Web Deployment With Visual Studio 2010
 
Grails plugin
Grails pluginGrails plugin
Grails plugin
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
Building a Cloud API Server using Play(SCALA) & Riak
Building a Cloud API Server using  Play(SCALA) & Riak Building a Cloud API Server using  Play(SCALA) & Riak
Building a Cloud API Server using Play(SCALA) & Riak
 
Asp.net identity 2.0
Asp.net identity 2.0Asp.net identity 2.0
Asp.net identity 2.0
 
PostgREST Design Philosophy
PostgREST Design PhilosophyPostgREST Design Philosophy
PostgREST Design Philosophy
 
Very Brief Intro to Catalyst
Very Brief Intro to CatalystVery Brief Intro to Catalyst
Very Brief Intro to Catalyst
 
Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30) Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30)
 
Azure Durable Functions
Azure Durable FunctionsAzure Durable Functions
Azure Durable Functions
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)
 
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)
Serverless APIs, the Good, the Bad and the Ugly (2019-09-19)
 
Node.js and Parse
Node.js and ParseNode.js and Parse
Node.js and Parse
 

Viewers also liked

Сантехника Incea – Сделано в Италии от Stockist Italy
Сантехника Incea – Сделано в Италии от Stockist Italy Сантехника Incea – Сделано в Италии от Stockist Italy
Сантехника Incea – Сделано в Италии от Stockist Italy
P.L.T. Forniture Industriali S.r.l.
 
Atmosfera
AtmosferaAtmosfera
Atmosfera
Nute Jpa
 
Planning booklet
Planning bookletPlanning booklet
Planning booklet
bobbiehaslam
 
Stockist Italy presentation in German 2016
Stockist Italy presentation in German 2016 Stockist Italy presentation in German 2016
Stockist Italy presentation in German 2016
P.L.T. Forniture Industriali S.r.l.
 
Душевые кабины Friges – Приложение 2 от Stockist Italy
Душевые кабины Friges – Приложение 2 от Stockist Italy Душевые кабины Friges – Приложение 2 от Stockist Italy
Душевые кабины Friges – Приложение 2 от Stockist Italy
P.L.T. Forniture Industriali S.r.l.
 
Душевые кабины Friges - Приложение 1 от Stockist Italy
Душевые кабины Friges - Приложение 1 от Stockist Italy Душевые кабины Friges - Приложение 1 от Stockist Italy
Душевые кабины Friges - Приложение 1 от Stockist Italy
P.L.T. Forniture Industriali S.r.l.
 
Моносплит Hokkaido от компании Stockist Italy – технические характеристики
Моносплит Hokkaido от компании Stockist Italy – технические характеристики Моносплит Hokkaido от компании Stockist Italy – технические характеристики
Моносплит Hokkaido от компании Stockist Italy – технические характеристики
P.L.T. Forniture Industriali S.r.l.
 
Lo1 workbook
Lo1 workbookLo1 workbook
Lo1 workbook
bobtrelfa
 
Cloud hub deployment
Cloud hub deploymentCloud hub deployment
Cloud hub deployment
sivachandra mandalapu
 
How to use secure property placeholder
How to use secure property placeholderHow to use secure property placeholder
How to use secure property placeholder
sivachandra mandalapu
 
Bean as Datasource
Bean as DatasourceBean as Datasource
Bean as Datasource
sivachandra mandalapu
 
Splitter
SplitterSplitter
How to use SFTP
How to use SFTPHow to use SFTP
How to use SFTP
sivachandra mandalapu
 
Securing api with_o_auth2
Securing api with_o_auth2Securing api with_o_auth2
Securing api with_o_auth2
sivachandra mandalapu
 
Lion King London
Lion King LondonLion King London
Lion King London
Theatre
 
Defining global exception strategies
Defining global exception strategiesDefining global exception strategies
Defining global exception strategies
sivachandra mandalapu
 
Sap
SapSap
Specifying a default exception strategy
Specifying a default exception strategySpecifying a default exception strategy
Specifying a default exception strategy
sivachandra mandalapu
 
Salesforce
SalesforceSalesforce
Validation
ValidationValidation

Viewers also liked (20)

Сантехника Incea – Сделано в Италии от Stockist Italy
Сантехника Incea – Сделано в Италии от Stockist Italy Сантехника Incea – Сделано в Италии от Stockist Italy
Сантехника Incea – Сделано в Италии от Stockist Italy
 
Atmosfera
AtmosferaAtmosfera
Atmosfera
 
Planning booklet
Planning bookletPlanning booklet
Planning booklet
 
Stockist Italy presentation in German 2016
Stockist Italy presentation in German 2016 Stockist Italy presentation in German 2016
Stockist Italy presentation in German 2016
 
Душевые кабины Friges – Приложение 2 от Stockist Italy
Душевые кабины Friges – Приложение 2 от Stockist Italy Душевые кабины Friges – Приложение 2 от Stockist Italy
Душевые кабины Friges – Приложение 2 от Stockist Italy
 
Душевые кабины Friges - Приложение 1 от Stockist Italy
Душевые кабины Friges - Приложение 1 от Stockist Italy Душевые кабины Friges - Приложение 1 от Stockist Italy
Душевые кабины Friges - Приложение 1 от Stockist Italy
 
Моносплит Hokkaido от компании Stockist Italy – технические характеристики
Моносплит Hokkaido от компании Stockist Italy – технические характеристики Моносплит Hokkaido от компании Stockist Italy – технические характеристики
Моносплит Hokkaido от компании Stockist Italy – технические характеристики
 
Lo1 workbook
Lo1 workbookLo1 workbook
Lo1 workbook
 
Cloud hub deployment
Cloud hub deploymentCloud hub deployment
Cloud hub deployment
 
How to use secure property placeholder
How to use secure property placeholderHow to use secure property placeholder
How to use secure property placeholder
 
Bean as Datasource
Bean as DatasourceBean as Datasource
Bean as Datasource
 
Splitter
SplitterSplitter
Splitter
 
How to use SFTP
How to use SFTPHow to use SFTP
How to use SFTP
 
Securing api with_o_auth2
Securing api with_o_auth2Securing api with_o_auth2
Securing api with_o_auth2
 
Lion King London
Lion King LondonLion King London
Lion King London
 
Defining global exception strategies
Defining global exception strategiesDefining global exception strategies
Defining global exception strategies
 
Sap
SapSap
Sap
 
Specifying a default exception strategy
Specifying a default exception strategySpecifying a default exception strategy
Specifying a default exception strategy
 
Salesforce
SalesforceSalesforce
Salesforce
 
Validation
ValidationValidation
Validation
 

Similar to API gateway setup

Manage your APIs and Microservices with an API Gateway
Manage your APIs and Microservices with an API GatewayManage your APIs and Microservices with an API Gateway
Manage your APIs and Microservices with an API Gateway
Thibault Charbonnier
 
MesosCon - Be a microservices hero
MesosCon - Be a microservices heroMesosCon - Be a microservices hero
MesosCon - Be a microservices hero
Dragos Dascalita Haut
 
Introduction to CloudStack API
Introduction to CloudStack APIIntroduction to CloudStack API
Introduction to CloudStack API
Krunal Jain
 
Php frameworks
Php frameworksPhp frameworks
Php frameworks
Anil Kumar Panigrahi
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
Spiffy
 
Introduction to the Archivematica API (September 2018)
Introduction to the Archivematica API (September 2018)Introduction to the Archivematica API (September 2018)
Introduction to the Archivematica API (September 2018)
Artefactual Systems - Archivematica
 
Building microservices sample application
Building microservices sample applicationBuilding microservices sample application
Building microservices sample application
Anil Allewar
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio Haro
QuickBase, Inc.
 
OpenStack API's and WSGI
OpenStack API's and WSGIOpenStack API's and WSGI
OpenStack API's and WSGI
Mike Pittaro
 
Forge: Under the Hood
Forge: Under the HoodForge: Under the Hood
Forge: Under the Hood
Atlassian
 
Mock Servers - Fake All the Things!
Mock Servers - Fake All the Things!Mock Servers - Fake All the Things!
Mock Servers - Fake All the Things!
Atlassian
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
Remy Sharp
 
Quick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase ServerQuick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase Server
Nic Raboy
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)
Vendic Magento, PWA & Marketing
 
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
Matt Raible
 
Service-Oriented Integration With Apache ServiceMix
Service-Oriented Integration With Apache ServiceMixService-Oriented Integration With Apache ServiceMix
Service-Oriented Integration With Apache ServiceMix
Bruce Snyder
 
Using Istio to Secure & Monitor Your Services
Using Istio to Secure & Monitor Your ServicesUsing Istio to Secure & Monitor Your Services
Using Istio to Secure & Monitor Your Services
Alcide
 
Visualizing Big Data in Realtime
Visualizing Big Data in RealtimeVisualizing Big Data in Realtime
Visualizing Big Data in Realtime
DataWorks Summit
 
Federico Feroldi - Scala microservices
Federico Feroldi - Scala microservicesFederico Feroldi - Scala microservices
Federico Feroldi - Scala microservices
Scala Italy
 
WSO2 Italia Open Break Session #2 - Microgateway
WSO2 Italia Open Break Session #2 - MicrogatewayWSO2 Italia Open Break Session #2 - Microgateway
WSO2 Italia Open Break Session #2 - Microgateway
Profesia Srl, Lynx Group
 

Similar to API gateway setup (20)

Manage your APIs and Microservices with an API Gateway
Manage your APIs and Microservices with an API GatewayManage your APIs and Microservices with an API Gateway
Manage your APIs and Microservices with an API Gateway
 
MesosCon - Be a microservices hero
MesosCon - Be a microservices heroMesosCon - Be a microservices hero
MesosCon - Be a microservices hero
 
Introduction to CloudStack API
Introduction to CloudStack APIIntroduction to CloudStack API
Introduction to CloudStack API
 
Php frameworks
Php frameworksPhp frameworks
Php frameworks
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
 
Introduction to the Archivematica API (September 2018)
Introduction to the Archivematica API (September 2018)Introduction to the Archivematica API (September 2018)
Introduction to the Archivematica API (September 2018)
 
Building microservices sample application
Building microservices sample applicationBuilding microservices sample application
Building microservices sample application
 
Saving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio HaroSaving Time And Effort With QuickBase Api - Sergio Haro
Saving Time And Effort With QuickBase Api - Sergio Haro
 
OpenStack API's and WSGI
OpenStack API's and WSGIOpenStack API's and WSGI
OpenStack API's and WSGI
 
Forge: Under the Hood
Forge: Under the HoodForge: Under the Hood
Forge: Under the Hood
 
Mock Servers - Fake All the Things!
Mock Servers - Fake All the Things!Mock Servers - Fake All the Things!
Mock Servers - Fake All the Things!
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
 
Quick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase ServerQuick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase Server
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)
 
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
 
Service-Oriented Integration With Apache ServiceMix
Service-Oriented Integration With Apache ServiceMixService-Oriented Integration With Apache ServiceMix
Service-Oriented Integration With Apache ServiceMix
 
Using Istio to Secure & Monitor Your Services
Using Istio to Secure & Monitor Your ServicesUsing Istio to Secure & Monitor Your Services
Using Istio to Secure & Monitor Your Services
 
Visualizing Big Data in Realtime
Visualizing Big Data in RealtimeVisualizing Big Data in Realtime
Visualizing Big Data in Realtime
 
Federico Feroldi - Scala microservices
Federico Feroldi - Scala microservicesFederico Feroldi - Scala microservices
Federico Feroldi - Scala microservices
 
WSO2 Italia Open Break Session #2 - Microgateway
WSO2 Italia Open Break Session #2 - MicrogatewayWSO2 Italia Open Break Session #2 - Microgateway
WSO2 Italia Open Break Session #2 - Microgateway
 

More from sivachandra mandalapu

Mock component in munit
Mock component in munitMock component in munit
Mock component in munit
sivachandra mandalapu
 
Jms selector
Jms selectorJms selector
Jms selector
sivachandra mandalapu
 
Sftplite
SftpliteSftplite
Object store
Object storeObject store
Object store
sivachandra mandalapu
 
Reference exception strategy
Reference exception strategyReference exception strategy
Reference exception strategy
sivachandra mandalapu
 
Validate json schema
Validate json schemaValidate json schema
Validate json schema
sivachandra mandalapu
 
Property place holder
Property place holderProperty place holder
Property place holder
sivachandra mandalapu
 
Collection aggregator
Collection aggregatorCollection aggregator
Collection aggregator
sivachandra mandalapu
 
Deployment options for mule applications
Deployment options for mule applicationsDeployment options for mule applications
Deployment options for mule applications
sivachandra mandalapu
 
Setting up organization with api access
Setting up organization with api accessSetting up organization with api access
Setting up organization with api access
sivachandra mandalapu
 
Expression
ExpressionExpression
Synchronous communication using jms back channel
Synchronous communication using jms back channelSynchronous communication using jms back channel
Synchronous communication using jms back channel
sivachandra mandalapu
 
Data Mapper
Data MapperData Mapper
Wildcard Filter
Wildcard FilterWildcard Filter
Wildcard Filter
sivachandra mandalapu
 
Soap Component
Soap ComponentSoap Component
Soap Component
sivachandra mandalapu
 
Rest Component
Rest ComponentRest Component
Rest Component
sivachandra mandalapu
 
Integration with dropbox using mule esb
Integration with dropbox using mule esbIntegration with dropbox using mule esb
Integration with dropbox using mule esb
sivachandra mandalapu
 
Integration of mule esb with microsoft azure
Integration of mule esb with microsoft azureIntegration of mule esb with microsoft azure
Integration of mule esb with microsoft azure
sivachandra mandalapu
 
Not Filter
Not FilterNot Filter

More from sivachandra mandalapu (19)

Mock component in munit
Mock component in munitMock component in munit
Mock component in munit
 
Jms selector
Jms selectorJms selector
Jms selector
 
Sftplite
SftpliteSftplite
Sftplite
 
Object store
Object storeObject store
Object store
 
Reference exception strategy
Reference exception strategyReference exception strategy
Reference exception strategy
 
Validate json schema
Validate json schemaValidate json schema
Validate json schema
 
Property place holder
Property place holderProperty place holder
Property place holder
 
Collection aggregator
Collection aggregatorCollection aggregator
Collection aggregator
 
Deployment options for mule applications
Deployment options for mule applicationsDeployment options for mule applications
Deployment options for mule applications
 
Setting up organization with api access
Setting up organization with api accessSetting up organization with api access
Setting up organization with api access
 
Expression
ExpressionExpression
Expression
 
Synchronous communication using jms back channel
Synchronous communication using jms back channelSynchronous communication using jms back channel
Synchronous communication using jms back channel
 
Data Mapper
Data MapperData Mapper
Data Mapper
 
Wildcard Filter
Wildcard FilterWildcard Filter
Wildcard Filter
 
Soap Component
Soap ComponentSoap Component
Soap Component
 
Rest Component
Rest ComponentRest Component
Rest Component
 
Integration with dropbox using mule esb
Integration with dropbox using mule esbIntegration with dropbox using mule esb
Integration with dropbox using mule esb
 
Integration of mule esb with microsoft azure
Integration of mule esb with microsoft azureIntegration of mule esb with microsoft azure
Integration of mule esb with microsoft azure
 
Not Filter
Not FilterNot Filter
Not Filter
 

Recently uploaded

clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 

Recently uploaded (20)

clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 

API gateway setup

  • 1. { API GATEWAY SETUP INTRODUCTION The API Gateway runtime points to the backend APIs and services that you define and abstracts them into a layer that the Anypoint Platform manages. Consumer applications invoke your services. APIs route to the endpoints that the gateway exposes to enforce runtime policies and collect and track analytics data. The API Gateway acts as a dedicated orchestration layer for all your backend APIs to separate orchestration from implementation concerns. The gateway leverages the governance capabilities of the API Manager, so that you can apply throttling, security, and other policies to your APIs.
  • 2.
  • 3. Pre requisites  AnypointStudio 3.6.0+  Jdk 1.7  APIKit  Cloudhub account
  • 4.  Process  Here, I am going to create a POC (Addition of 2 numbers) in Mule (3.6), deploy the application in Cloud and apply proxy for the same.  Step 1  POC (Addition of 2 numbers):  Flow:
  • 5.
  • 6.
  • 7.
  • 10.  .mflow <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:apikit="http://www.mulesoft.org/schema/mule/apikit" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/apikit http://www.mulesoft.org/schema/mule/apikit/current/mule-apikit.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd" version="EE-3.5.2"> <apikit:config name="api-config" raml="api.raml" consoleEnabled="true" consolePath="console" doc:name="Router"/> <apikit:mapping-exception-strategy name="api-apiKitGlobalExceptionMapping" doc:name="Mapping Exception Strategy"> <apikit:mapping statusCode="404"> <apikit:exception value="org.mule.module.apikit.exception.NotFoundException" /> <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/> <set-payload value="{ &quot;message&quot;: &quot;Resource not found&quot; }" doc:name="Set Payload"/> </apikit:mapping> <apikit:mapping statusCode="405"> <apikit:exception value="org.mule.module.apikit.exception.MethodNotAllowedException" /> <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/> <set-payload value="{ &quot;message&quot;: &quot;Method not allowed&quot; }" doc:name="Set Payload"/> </apikit:mapping> <apikit:mapping statusCode="415"> <apikit:exception value="org.mule.module.apikit.exception.UnsupportedMediaTypeException" /> <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/> <set-payload value="{ &quot;message&quot;: &quot;Unsupported media type&quot; }" doc:name="Set Payload"/> </apikit:mapping> <apikit:mapping statusCode="406"> <apikit:exception value="org.mule.module.apikit.exception.NotAcceptableException" /> <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/> <set-payload value="{ &quot;message&quot;: &quot;Not acceptable&quot; }" doc:name="Set Payload"/> </apikit:mapping> <apikit:mapping statusCode="400"> <apikit:exception value="org.mule.module.apikit.exception.BadRequestException" /> <set-property propertyName="Content-Type" value="application/json" doc:name="Property"/> <set-payload value="{ &quot;message&quot;: &quot;Bad request&quot; }" doc:name="Set Payload"/> </apikit:mapping> </apikit:mapping-exception-strategy> <flow name="api-main" doc:name="api-main"> <http:inbound-endpoint doc:name="HTTP" exchange-pattern="request-response" host="localhost" path="add" port="8081"/> <apikit:router config-ref="api-config" doc:name="APIkit Router"/> <exception-strategy ref="api-apiKitGlobalExceptionMapping" doc:name="Reference Exception Strategy"/> </flow> <flow name="get:/Addition/{num1}/{num2}:api-config" doc:name="get:/Addition/{num1}/{num2}:api-config"> <set-payload value="#[Integer.parseInt(flowVars['num1'])+Integer.parseInt(flowVars['num2'])]" doc:name="Set Payload"/> </flow> </mule>
  • 11.  api.raml: #%RAML 0.8 --- title: Addition of two numbers baseUri: http://addition-api/api version: 1.0 /Addition/{num1}/{num2}: displayName: Provide input Details here get: description: Enter input details responses: 200: body: application/json:
  • 12.  Step 2  Deploy and test the above POC in cloud:  Login to the anypoint.mulesoft.com (cloudhub).  https://anypoint.mulesoft.com/login/#/signin  Go to Runtime Manager tab and deploy the above POC.  Click Deploy application tab, upload the zip file (POC) and deploy the application.  Provide application name, zip file, runtime version and deploy the application.
  • 13.  Test the application:  Service URL:  -> Get the service URL from the logs of above deployed application.  Open the above URL in browser and provide the input details accordingly.
  • 14.
  • 15.
  • 16.  Step 3  How to apply proxy for the above deployed application:  Go to API Manager.  Click Add new API tab.  Provide the new API details.  Provide the above created RAML file and update the baseURL (get it from Step 2: C.1).  Create new portal.  Configure endpoint details.  Request API access to get the new clientID and client secret details.  Apply clientID policy.  Deploy the proxy.
  • 17.  Get the proxy URL from the logs of above deployed application.  Test the deployed application.
  • 18.