SlideShare a Scribd company logo
Sharing Resources - Mule
- Anil Kumar. V
1
Mule is flexible and supports sharing of connectors as common resources. In many scenario’s, we
often require to share the common resources between the applications which are deployed under
the same “Domain”.
The advantage of sharing the resources, allows multiple applications/development team(s) with in the
same domain to work with the same set of pre-configured connectors.
For example, application a and application b both require inbound HTTP listeners which are
consuming the same port “8989”. In this scenario, we can create only ONE listener configuration and
share between the two applications a & b.
At this current stage, only the following connectors can be used as shared resources:
. HTTP/HTTPS
. VM
. TLS
. JMS
. JMS Caching Connection Factory
. Database
. WMQ
. JBoss Transaction Manager
. Bitronix Transaction Manager
2
3
How can we create SHARED RESOURCES????
To create shared resources, follow these steps:
1. Create new domain project
2. Define the shared resources
3. Create application(s) and associate to the domain
4. Test the application(s) by deploying the domain and the
application(s)
4
Step 1: Create new domain project
create domain project in Anypoint Studio, by selecting the top menu bar
select File > New > Mule Domain Project
5
After performing Step 1, you will see “mule-domain-config.xml” file under src/main/domain
as shown below:
Step 2: Add an HTTP connector as a shared resources viz.,
“Shared_HTTP_Listener_configuration” to “mule-domain-config.xml”
which is created in previous step.
Code snippet: <http:listener-config name="Shared_HTTP_Listener_Configuration" host="localhost" port="8989"
doc:name="HTTP Listener Configuration"/>
6
Step 3: Now its time to create Mule Project viz., “Application A”
and attaching it to the domain project created in Step 1.
Step 3.1: Create project in Anypoint Studio, by selecting the top menu bar
select File > New > Mule Project
7
Step 3.2: Open the “application_a.xml” and drag & drop the HTTP Endpoint from the
palette to the canvas. If we check the “Connector Configuration” the drop down
list is empty, wait a minute where is the “Shared Resource” that we created in
previous Steps?
Hmmm…. We forgot to add this project to the “Domain” project.
To do so, open the “mule-project.xml” under “application_a” project and change
the “Domain” name from the drop down list to “mySharedResourcesDomain” as
per below figure.
8
Step 3.3: Now open the “application_a.xml” again and you notice that the “Connector
Configuration” is pre-populated with the “Shared Resource” that we created in
previous Step.
HURRAY!!!!!
And set the path to “/appa” then add a set-payload transformer to the flow with value “You are viewing message from
Application A using Shared Resources”.
Step 3.4: Now its time to create another Mule Project viz., “Application B”
by repeating from Step 3, with below changes to “Application B”
. Path to “/appb”
. Payload message to “You are viewing message from Application B using Shared Resources”
9
Step 4: Now its time to test the Domain and the associated applications.
Right click on the “mule-domain-config.xml” and select “Run Configurations” from “Run As”
Select the “mysharedresourcesdomain” form the “Run Configurations” dialog box (make
sure that both the applications are ticked when selecting the “shared domain” project) and
then click on “Run”.
10
Step 4.1: Lets check the console, you will notice that bot the applications (a & b) are started
along with the domain.
Hurray!!! Both the applications are successfully deployed. Now its time to check the applications for
the results.
Application A is using the URL http://localhost:8989/appa and the result is displayed in browser:
Application B is using the URL http://localhost:8989/appb and the result is displayed in browser:
11
Now you know how to use Shared Resources among multiple applications. Like mentioned in previous
slide(s), you can use the shared resources:
. HTTP/HTTPS
. VM
. TLS
. JMS
. JMS Caching Connection Factory
. Database
. WMQ
. JBoss Transaction Manager
. Bitronix Transaction Manager
12
Ad

More Related Content

What's hot (20)

Deploy mule application
Deploy mule applicationDeploy mule application
Deploy mule application
Son Nguyen
 
Generating Documentation for Mule ESB Application
Generating Documentation for Mule ESB ApplicationGenerating Documentation for Mule ESB Application
Generating Documentation for Mule ESB Application
Rupesh Sinha
 
Mule soa
Mule soaMule soa
Mule soa
Khasim Saheb
 
Mule maven
Mule mavenMule maven
Mule maven
JavierMarRas
 
Scatter and gather in mule
Scatter and gather in muleScatter and gather in mule
Scatter and gather in mule
Rajkattamuri
 
Best way to deploy mule application
Best way to deploy mule applicationBest way to deploy mule application
Best way to deploy mule application
Sanjeet Pandey
 
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
 
Content based routing tutorial in mule
Content based routing tutorial in muleContent based routing tutorial in mule
Content based routing tutorial in mule
Sindhu VL
 
Mule batch job
Mule batch jobMule batch job
Mule batch job
Anirban Sen Chowdhary
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
Rajkattamuri
 
Introduction testingmule
Introduction testingmuleIntroduction testingmule
Introduction testingmule
Srikrishna k
 
Automatic documentation with mule
Automatic documentation with mule Automatic documentation with mule
Automatic documentation with mule
Anirban Sen Chowdhary
 
Mulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other ApplicationsMulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other Applications
kumar gaurav
 
Mule cloudhub application
Mule cloudhub applicationMule cloudhub application
Mule cloudhub application
D.Rajesh Kumar
 
Create Account in Salesforce using Mule ESB
Create Account in Salesforce using Mule ESBCreate Account in Salesforce using Mule ESB
Create Account in Salesforce using Mule ESB
Sanjeet Pandey
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
Khan625
 
Mule Tcat server
Mule  Tcat serverMule  Tcat server
Mule Tcat server
D.Rajesh Kumar
 
Integration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESBIntegration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESB
Rupesh Sinha
 
Configuration patterns in mule
Configuration patterns in muleConfiguration patterns in mule
Configuration patterns in mule
sathishmca143
 
Testing mule
Testing   muleTesting   mule
Testing mule
Sindhu VL
 
Deploy mule application
Deploy mule applicationDeploy mule application
Deploy mule application
Son Nguyen
 
Generating Documentation for Mule ESB Application
Generating Documentation for Mule ESB ApplicationGenerating Documentation for Mule ESB Application
Generating Documentation for Mule ESB Application
Rupesh Sinha
 
Scatter and gather in mule
Scatter and gather in muleScatter and gather in mule
Scatter and gather in mule
Rajkattamuri
 
Best way to deploy mule application
Best way to deploy mule applicationBest way to deploy mule application
Best way to deploy mule application
Sanjeet Pandey
 
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
 
Content based routing tutorial in mule
Content based routing tutorial in muleContent based routing tutorial in mule
Content based routing tutorial in mule
Sindhu VL
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
Rajkattamuri
 
Introduction testingmule
Introduction testingmuleIntroduction testingmule
Introduction testingmule
Srikrishna k
 
Mulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other ApplicationsMulesoft Calling Flow of Other Applications
Mulesoft Calling Flow of Other Applications
kumar gaurav
 
Mule cloudhub application
Mule cloudhub applicationMule cloudhub application
Mule cloudhub application
D.Rajesh Kumar
 
Create Account in Salesforce using Mule ESB
Create Account in Salesforce using Mule ESBCreate Account in Salesforce using Mule ESB
Create Account in Salesforce using Mule ESB
Sanjeet Pandey
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
Khan625
 
Integration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESBIntegration with Dropbox using Mule ESB
Integration with Dropbox using Mule ESB
Rupesh Sinha
 
Configuration patterns in mule
Configuration patterns in muleConfiguration patterns in mule
Configuration patterns in mule
sathishmca143
 
Testing mule
Testing   muleTesting   mule
Testing mule
Sindhu VL
 

Similar to Sharing Resources - Mule (20)

Mule Integration with Dropbox
Mule Integration with DropboxMule Integration with Dropbox
Mule Integration with Dropbox
Ramakrishna Narkedamilli
 
Hudson_WhitePaper
Hudson_WhitePaperHudson_WhitePaper
Hudson_WhitePaper
Farrukh Jalil
 
Dropbox with Mule
Dropbox with MuleDropbox with Mule
Dropbox with Mule
Manav Prasad
 
Mule ESB - Intra application communication
Mule ESB - Intra application communicationMule ESB - Intra application communication
Mule ESB - Intra application communication
krishananth
 
Deploying mule applications
Deploying mule applicationsDeploying mule applications
Deploying mule applications
Bhargav Ranjit
 
Homestead Weather workshop
Homestead Weather workshopHomestead Weather workshop
Homestead Weather workshop
Jean-Louis (JL) Marechaux
 
Deploying to cloud hub
Deploying to cloud hubDeploying to cloud hub
Deploying to cloud hub
Son Nguyen
 
Deployingmuleapplications 160903085602
Deployingmuleapplications 160903085602Deployingmuleapplications 160903085602
Deployingmuleapplications 160903085602
ppts123456
 
Mobile Apps Development Using Flash Builder 4.5
Mobile Apps Development Using Flash Builder 4.5Mobile Apps Development Using Flash Builder 4.5
Mobile Apps Development Using Flash Builder 4.5
Bharat Patel
 
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
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 servers
Mark Myers
 
Containers Lab
Containers Lab Containers Lab
Containers Lab
Dev_Events
 
Dvwkbm lab2 cli1
Dvwkbm lab2 cli1Dvwkbm lab2 cli1
Dvwkbm lab2 cli1
Saranga Tripathy
 
Integration with dropbox
Integration with dropboxIntegration with dropbox
Integration with dropbox
Son Nguyen
 
Introduction to Bluemix and Watson
Introduction to Bluemix and WatsonIntroduction to Bluemix and Watson
Introduction to Bluemix and Watson
Jake Peyser
 
Web Controls Set-1
Web Controls Set-1Web Controls Set-1
Web Controls Set-1
sunmitraeducation
 
Syncitall
SyncitallSyncitall
Syncitall
Aakash Praliya
 
Salesforce ANT migration
Salesforce ANT migration Salesforce ANT migration
Salesforce ANT migration
Cloud Analogy
 
My First Hadoop Program !!!
My First Hadoop Program !!!My First Hadoop Program !!!
My First Hadoop Program !!!
Ayapparaj SKS
 
Hdfs connector
Hdfs connectorHdfs connector
Hdfs connector
kiranvanga
 
Mule ESB - Intra application communication
Mule ESB - Intra application communicationMule ESB - Intra application communication
Mule ESB - Intra application communication
krishananth
 
Deploying mule applications
Deploying mule applicationsDeploying mule applications
Deploying mule applications
Bhargav Ranjit
 
Deploying to cloud hub
Deploying to cloud hubDeploying to cloud hub
Deploying to cloud hub
Son Nguyen
 
Deployingmuleapplications 160903085602
Deployingmuleapplications 160903085602Deployingmuleapplications 160903085602
Deployingmuleapplications 160903085602
ppts123456
 
Mobile Apps Development Using Flash Builder 4.5
Mobile Apps Development Using Flash Builder 4.5Mobile Apps Development Using Flash Builder 4.5
Mobile Apps Development Using Flash Builder 4.5
Bharat Patel
 
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
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 servers
Mark Myers
 
Containers Lab
Containers Lab Containers Lab
Containers Lab
Dev_Events
 
Integration with dropbox
Integration with dropboxIntegration with dropbox
Integration with dropbox
Son Nguyen
 
Introduction to Bluemix and Watson
Introduction to Bluemix and WatsonIntroduction to Bluemix and Watson
Introduction to Bluemix and Watson
Jake Peyser
 
Salesforce ANT migration
Salesforce ANT migration Salesforce ANT migration
Salesforce ANT migration
Cloud Analogy
 
My First Hadoop Program !!!
My First Hadoop Program !!!My First Hadoop Program !!!
My First Hadoop Program !!!
Ayapparaj SKS
 
Hdfs connector
Hdfs connectorHdfs connector
Hdfs connector
kiranvanga
 
Ad

Recently uploaded (20)

Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Ad

Sharing Resources - Mule

  • 1. Sharing Resources - Mule - Anil Kumar. V 1
  • 2. Mule is flexible and supports sharing of connectors as common resources. In many scenario’s, we often require to share the common resources between the applications which are deployed under the same “Domain”. The advantage of sharing the resources, allows multiple applications/development team(s) with in the same domain to work with the same set of pre-configured connectors. For example, application a and application b both require inbound HTTP listeners which are consuming the same port “8989”. In this scenario, we can create only ONE listener configuration and share between the two applications a & b. At this current stage, only the following connectors can be used as shared resources: . HTTP/HTTPS . VM . TLS . JMS . JMS Caching Connection Factory . Database . WMQ . JBoss Transaction Manager . Bitronix Transaction Manager 2
  • 3. 3 How can we create SHARED RESOURCES???? To create shared resources, follow these steps: 1. Create new domain project 2. Define the shared resources 3. Create application(s) and associate to the domain 4. Test the application(s) by deploying the domain and the application(s)
  • 4. 4 Step 1: Create new domain project create domain project in Anypoint Studio, by selecting the top menu bar select File > New > Mule Domain Project
  • 5. 5 After performing Step 1, you will see “mule-domain-config.xml” file under src/main/domain as shown below: Step 2: Add an HTTP connector as a shared resources viz., “Shared_HTTP_Listener_configuration” to “mule-domain-config.xml” which is created in previous step. Code snippet: <http:listener-config name="Shared_HTTP_Listener_Configuration" host="localhost" port="8989" doc:name="HTTP Listener Configuration"/>
  • 6. 6 Step 3: Now its time to create Mule Project viz., “Application A” and attaching it to the domain project created in Step 1. Step 3.1: Create project in Anypoint Studio, by selecting the top menu bar select File > New > Mule Project
  • 7. 7 Step 3.2: Open the “application_a.xml” and drag & drop the HTTP Endpoint from the palette to the canvas. If we check the “Connector Configuration” the drop down list is empty, wait a minute where is the “Shared Resource” that we created in previous Steps? Hmmm…. We forgot to add this project to the “Domain” project. To do so, open the “mule-project.xml” under “application_a” project and change the “Domain” name from the drop down list to “mySharedResourcesDomain” as per below figure.
  • 8. 8 Step 3.3: Now open the “application_a.xml” again and you notice that the “Connector Configuration” is pre-populated with the “Shared Resource” that we created in previous Step. HURRAY!!!!! And set the path to “/appa” then add a set-payload transformer to the flow with value “You are viewing message from Application A using Shared Resources”. Step 3.4: Now its time to create another Mule Project viz., “Application B” by repeating from Step 3, with below changes to “Application B” . Path to “/appb” . Payload message to “You are viewing message from Application B using Shared Resources”
  • 9. 9 Step 4: Now its time to test the Domain and the associated applications. Right click on the “mule-domain-config.xml” and select “Run Configurations” from “Run As” Select the “mysharedresourcesdomain” form the “Run Configurations” dialog box (make sure that both the applications are ticked when selecting the “shared domain” project) and then click on “Run”.
  • 10. 10 Step 4.1: Lets check the console, you will notice that bot the applications (a & b) are started along with the domain. Hurray!!! Both the applications are successfully deployed. Now its time to check the applications for the results. Application A is using the URL http://localhost:8989/appa and the result is displayed in browser: Application B is using the URL http://localhost:8989/appb and the result is displayed in browser:
  • 11. 11 Now you know how to use Shared Resources among multiple applications. Like mentioned in previous slide(s), you can use the shared resources: . HTTP/HTTPS . VM . TLS . JMS . JMS Caching Connection Factory . Database . WMQ . JBoss Transaction Manager . Bitronix Transaction Manager
  • 12. 12