SlideShare a Scribd company logo
1 of 8
How to use Cache Scope
Component
12-02-2016
Abstract
• The main motto of this PPT is how to use Cache Scope
component in our applications.
Introduction
• The Cache Scope processes the message, delivers the output
to the parent or caller flow and saves the output (i.e. caches
the response). The next time Mule sends the same kind of
message into the cache scope, the cache scope may offer a
cached response rather than invoking, again, a potentially
time-consuming process.
Example
.mflow
•.mflow• <?xml version="1.0" encoding="UTF-8"?>
• <mule xmlns:context="http://www.springframework.org/schema/context" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:ee=http://www.mulesoft.org/schema/mule/ee/core
• xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
• xmlns:spring="http://www.springframework.org/schema/beans"
• xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
• xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
• http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
• http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.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/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
• http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-current.xsd
• http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
• <http:request-config name="SabreHTTP_Request_Configuration" protocol="HTTPS" host="${ehbe.sabre.host}" port="${ehbe.sabre.port}" basePath="/" doc:name="HTTP Request Configuration"/>
• <http:listener-config name="SabreHTTP_Listener_Configuration" host="localhost" port="8082" basePath="Sabre" doc:name="HTTP Listener Configuration"/>
• <ee:object-store-caching-strategy name="Caching_Strategy" doc:name="Caching Strategy">
• <in-memory-store name="SabreSessionCreate" maxEntries="-1" entryTTL="${sabre.session.refreshInterval}" expirationInterval="${sabre.session.refreshInterval}"/>
• </ee:object-store-caching-strategy>
• <context:property-placeholder location="file:${mule_home}/conf/esb-ehbe-common.properties"/>
• <flow name="SessionCreateFlow">
• <http:listener config-ref="SabreHTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
• <ee:cache cachingStrategy-ref="Caching_Strategy" doc:name="Cache">
• <set-payload value="&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV = &quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:eb = &quot;http://www.ebxml.org/namespaces/messageHeader&quot;
• xmlns:xlink = &quot;http://www.w3.org/1999/xlink&quot; xmlns:xsd = &quot;http://www.w3.org/1999/XMLSchema&quot;&gt; &lt;SOAP-ENV:Header&gt; &lt;eb:MessageHeader SOAP-ENV:mustUnderstand = &quot;1&quot; eb:version = &quot;1.0&quot;&gt;
• &lt;eb:From&gt; &lt;eb:PartyId type = &quot;urn:x12.org:IO5:01&quot;&gt;999999&lt;/eb:PartyId&gt; &lt;/eb:From&gt; &lt;eb:To&gt; &lt;eb:PartyId type = &quot;urn:x12.org:IO5:01&quot;&gt;123123&lt;/eb:PartyId&gt;
• &lt;/eb:To&gt; &lt;eb:CPAId&gt;W2PH&lt;/eb:CPAId&gt; &lt;eb:ConversationId&gt;${sabre.session.conversationId}&lt;/eb:ConversationId&gt; &lt;eb:Service eb:type = &quot;OTA&quot;&gt;SessionCreateRQ&lt;/eb:Service&gt;
• &lt;eb:Action&gt;SessionCreateRQ&lt;/eb:Action&gt; &lt;eb:MessageData&gt; &lt;eb:MessageId&gt;1000&lt;/eb:MessageId&gt; &lt;/eb:MessageData&gt; &lt;/eb:MessageHeader&gt;
• &lt;wsse:Security xmlns:wsse = &quot;http://schemas.xmlsoap.org/ws/2002/12/secext&quot; xmlns:wsu = &quot;http://schemas.xmlsoap.org/ws/2002/12/utility&quot;&gt; &lt;wsse:UsernameToken&gt;
• &lt;wsse:Username&gt;${sabre.session.username}&lt;/wsse:Username&gt; &lt;wsse:Password&gt;${sabre.session.password}&lt;/wsse:Password&gt; &lt;Organization&gt;${sabre.session.organization}&lt;/Organization&gt;
• &lt;Domain&gt;DEFAULT&lt;/Domain&gt; &lt;/wsse:UsernameToken&gt; &lt;/wsse:Security&gt; &lt;/SOAP-ENV:Header&gt; &lt;SOAP-ENV:Body&gt; &lt;SessionCreateRQ returnContextID = &quot;true&quot;&gt; &lt;POS&gt;
• &lt;Source PseudoCityCode = &quot;W2PH&quot;/&gt; &lt;/POS&gt; &lt;/SessionCreateRQ&gt; &lt;ns:OTA_HotelAvailRQ xmlns:ns = &quot;http://webservices.sabre.com/sabreXML/2011/10&quot;&gt; &lt;ns:AvailRequestSegment/&gt;
• &lt;/ns:OTA_HotelAvailRQ&gt; &lt;/SOAP-ENV:Body&gt; &lt;/SOAP-ENV:Envelope&gt; " doc:name="CreateSessionRQPayload"/>
• <mulexml:dom-to-xml-transformer doc:name="DOM to XML"/>
• <http:request config-ref="SabreHTTP_Request_Configuration" path="/" method="POST" doc:name="HTTP"/>
• <logger message=":: :: Sabre new session creted :: :: " level="INFO" doc:name="Logger"/>
• </ee:cache>
• <logger message="Sabre session response--#[payload]" level="INFO" doc:name="Logger"/>
• </flow>
• </mule>
Output:
•
• Flow of execution:
1. URL to trigger the service from browser
http://localhost:8082/Sabre
2. When the flow triggered cache block will
execute first time and it will cache the response
up to 10 minutes. Mean while whenever we call
that flow it will return the response from cache
without executing the cache block.
References
• https://docs.mulesoft.com/mule-user-guide/v/3.7/cache-
scope

More Related Content

Viewers also liked

How to use database component using stored procedure call
How to use database component using stored procedure callHow to use database component using stored procedure call
How to use database component using stored procedure callprathyusha vadla
 
Claudia_Testanera_gennaio_2016
Claudia_Testanera_gennaio_2016Claudia_Testanera_gennaio_2016
Claudia_Testanera_gennaio_2016Claudia Testanera
 
прислівник
прислівникприслівник
прислівникMariya Yudina
 
Ed103format3 complete summary.docx[1]
Ed103format3 complete summary.docx[1]Ed103format3 complete summary.docx[1]
Ed103format3 complete summary.docx[1]mark maneb
 
Proceedings of-the-waste-safe-2015 (1)
Proceedings of-the-waste-safe-2015 (1)Proceedings of-the-waste-safe-2015 (1)
Proceedings of-the-waste-safe-2015 (1)Mushfiqur Rahman
 
Foodies April16 v3
Foodies April16 v3Foodies April16 v3
Foodies April16 v3Sahiri Loing
 

Viewers also liked (14)

Question 5
Question 5Question 5
Question 5
 
Effects
EffectsEffects
Effects
 
Question 2
Question 2Question 2
Question 2
 
How to use database component using stored procedure call
How to use database component using stored procedure callHow to use database component using stored procedure call
How to use database component using stored procedure call
 
Man and van bournemouth
Man and van bournemouthMan and van bournemouth
Man and van bournemouth
 
Claudia_Testanera_gennaio_2016
Claudia_Testanera_gennaio_2016Claudia_Testanera_gennaio_2016
Claudia_Testanera_gennaio_2016
 
The production schedule
The production scheduleThe production schedule
The production schedule
 
Construction of digipak
Construction of digipakConstruction of digipak
Construction of digipak
 
Question 5
Question 5Question 5
Question 5
 
прислівник
прислівникприслівник
прислівник
 
Ed103format3 complete summary.docx[1]
Ed103format3 complete summary.docx[1]Ed103format3 complete summary.docx[1]
Ed103format3 complete summary.docx[1]
 
Proceedings of-the-waste-safe-2015 (1)
Proceedings of-the-waste-safe-2015 (1)Proceedings of-the-waste-safe-2015 (1)
Proceedings of-the-waste-safe-2015 (1)
 
Ancillary Development
Ancillary Development Ancillary Development
Ancillary Development
 
Foodies April16 v3
Foodies April16 v3Foodies April16 v3
Foodies April16 v3
 

Similar to How to use cache scope component

An Introduction to Solr
An Introduction to SolrAn Introduction to Solr
An Introduction to Solrtomhill
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsRicardo Varela
 
Mule-choice component
Mule-choice componentMule-choice component
Mule-choice componentDivyaSree1391
 
How to use choice component
How to use choice componentHow to use choice component
How to use choice componentmaheshtheapex
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixBruce Snyder
 
Choice component in mule
Choice component in mule Choice component in mule
Choice component in mule Rajkattamuri
 
Choice component
Choice component Choice component
Choice component F K
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mulejaveed_mhd
 
How to use expression filter
How to use expression filter How to use expression filter
How to use expression filter Praneethchampion
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filterirfan1008
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filterprinceirfancivil
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filterPhaniu
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filtermdfkhan625
 
Architecting Web Services
Architecting Web ServicesArchitecting Web Services
Architecting Web ServicesLorna Mitchell
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponentakshay yeluru
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filterSunil Komarapu
 

Similar to How to use cache scope component (20)

An Introduction to Solr
An Introduction to SolrAn Introduction to Solr
An Introduction to Solr
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile Widgets
 
Mule-choice component
Mule-choice componentMule-choice component
Mule-choice component
 
How to use choice component
How to use choice componentHow to use choice component
How to use choice component
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMix
 
Choice component
Choice component Choice component
Choice component
 
Choice component in mule
Choice component in mule Choice component in mule
Choice component in mule
 
Choice component
Choice component Choice component
Choice component
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mule
 
Mule Choice component
Mule Choice component Mule Choice component
Mule Choice component
 
Collection aggregator
Collection aggregatorCollection aggregator
Collection aggregator
 
How to use expression filter
How to use expression filter How to use expression filter
How to use expression filter
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
Architecting Web Services
Architecting Web ServicesArchitecting Web Services
Architecting Web Services
 
Expression Filters
Expression FiltersExpression Filters
Expression Filters
 
Howtouseforeachcomponent
HowtouseforeachcomponentHowtouseforeachcomponent
Howtouseforeachcomponent
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 

Recently uploaded

Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 

Recently uploaded (20)

Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 

How to use cache scope component

  • 1. How to use Cache Scope Component 12-02-2016
  • 2. Abstract • The main motto of this PPT is how to use Cache Scope component in our applications.
  • 3. Introduction • The Cache Scope processes the message, delivers the output to the parent or caller flow and saves the output (i.e. caches the response). The next time Mule sends the same kind of message into the cache scope, the cache scope may offer a cached response rather than invoking, again, a potentially time-consuming process.
  • 5. .mflow •.mflow• <?xml version="1.0" encoding="UTF-8"?> • <mule xmlns:context="http://www.springframework.org/schema/context" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:ee=http://www.mulesoft.org/schema/mule/ee/core • xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" • xmlns:spring="http://www.springframework.org/schema/beans" • xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" • xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd • http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd • http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.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/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd • http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-current.xsd • http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd"> • <http:request-config name="SabreHTTP_Request_Configuration" protocol="HTTPS" host="${ehbe.sabre.host}" port="${ehbe.sabre.port}" basePath="/" doc:name="HTTP Request Configuration"/> • <http:listener-config name="SabreHTTP_Listener_Configuration" host="localhost" port="8082" basePath="Sabre" doc:name="HTTP Listener Configuration"/> • <ee:object-store-caching-strategy name="Caching_Strategy" doc:name="Caching Strategy"> • <in-memory-store name="SabreSessionCreate" maxEntries="-1" entryTTL="${sabre.session.refreshInterval}" expirationInterval="${sabre.session.refreshInterval}"/> • </ee:object-store-caching-strategy> • <context:property-placeholder location="file:${mule_home}/conf/esb-ehbe-common.properties"/> • <flow name="SessionCreateFlow"> • <http:listener config-ref="SabreHTTP_Listener_Configuration" path="/" doc:name="HTTP"/> • <ee:cache cachingStrategy-ref="Caching_Strategy" doc:name="Cache"> • <set-payload value="&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV = &quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:eb = &quot;http://www.ebxml.org/namespaces/messageHeader&quot; • xmlns:xlink = &quot;http://www.w3.org/1999/xlink&quot; xmlns:xsd = &quot;http://www.w3.org/1999/XMLSchema&quot;&gt; &lt;SOAP-ENV:Header&gt; &lt;eb:MessageHeader SOAP-ENV:mustUnderstand = &quot;1&quot; eb:version = &quot;1.0&quot;&gt; • &lt;eb:From&gt; &lt;eb:PartyId type = &quot;urn:x12.org:IO5:01&quot;&gt;999999&lt;/eb:PartyId&gt; &lt;/eb:From&gt; &lt;eb:To&gt; &lt;eb:PartyId type = &quot;urn:x12.org:IO5:01&quot;&gt;123123&lt;/eb:PartyId&gt; • &lt;/eb:To&gt; &lt;eb:CPAId&gt;W2PH&lt;/eb:CPAId&gt; &lt;eb:ConversationId&gt;${sabre.session.conversationId}&lt;/eb:ConversationId&gt; &lt;eb:Service eb:type = &quot;OTA&quot;&gt;SessionCreateRQ&lt;/eb:Service&gt; • &lt;eb:Action&gt;SessionCreateRQ&lt;/eb:Action&gt; &lt;eb:MessageData&gt; &lt;eb:MessageId&gt;1000&lt;/eb:MessageId&gt; &lt;/eb:MessageData&gt; &lt;/eb:MessageHeader&gt; • &lt;wsse:Security xmlns:wsse = &quot;http://schemas.xmlsoap.org/ws/2002/12/secext&quot; xmlns:wsu = &quot;http://schemas.xmlsoap.org/ws/2002/12/utility&quot;&gt; &lt;wsse:UsernameToken&gt; • &lt;wsse:Username&gt;${sabre.session.username}&lt;/wsse:Username&gt; &lt;wsse:Password&gt;${sabre.session.password}&lt;/wsse:Password&gt; &lt;Organization&gt;${sabre.session.organization}&lt;/Organization&gt; • &lt;Domain&gt;DEFAULT&lt;/Domain&gt; &lt;/wsse:UsernameToken&gt; &lt;/wsse:Security&gt; &lt;/SOAP-ENV:Header&gt; &lt;SOAP-ENV:Body&gt; &lt;SessionCreateRQ returnContextID = &quot;true&quot;&gt; &lt;POS&gt; • &lt;Source PseudoCityCode = &quot;W2PH&quot;/&gt; &lt;/POS&gt; &lt;/SessionCreateRQ&gt; &lt;ns:OTA_HotelAvailRQ xmlns:ns = &quot;http://webservices.sabre.com/sabreXML/2011/10&quot;&gt; &lt;ns:AvailRequestSegment/&gt; • &lt;/ns:OTA_HotelAvailRQ&gt; &lt;/SOAP-ENV:Body&gt; &lt;/SOAP-ENV:Envelope&gt; " doc:name="CreateSessionRQPayload"/> • <mulexml:dom-to-xml-transformer doc:name="DOM to XML"/> • <http:request config-ref="SabreHTTP_Request_Configuration" path="/" method="POST" doc:name="HTTP"/> • <logger message=":: :: Sabre new session creted :: :: " level="INFO" doc:name="Logger"/> • </ee:cache> • <logger message="Sabre session response--#[payload]" level="INFO" doc:name="Logger"/> • </flow> • </mule>
  • 7. • Flow of execution: 1. URL to trigger the service from browser http://localhost:8082/Sabre 2. When the flow triggered cache block will execute first time and it will cache the response up to 10 minutes. Mean while whenever we call that flow it will return the response from cache without executing the cache block.