Written by Mir Musthafa Ali Pasha
Middleware Practice Head at Royal Cyber
A Mule Domain project can be created to include selected connectors as shared resources, which can be reused from different Mule applications associated with this domain project.
Note: Mule applications can be associated with only one domain at a time.
Domain Projects allows the developers to,
To create a dynamic Mule Domain project which can fetch the shared resources (HTTP and HTTPS listener configurations) based on the current environment and server name to be shared across all apps in the server. We want to maintain just one domain project for all runtimes present in all environments.
1) On Anypoint studio, Click File -> New -> Mule Domain Project.
2) Create 2 Global element properties, 1 each for HTTP and HTTPS listener configs.
Note: Set the port as ${http.private.port} and ${https.private.port}
3) Create a Configuration Property specifying the rule to pick the *.yaml file based on the environment (mule.env) and server domain (mule.domain).
4) Define the yaml files based on the mule.env (dev, qa, uat, sfdcqa) and mule.domain (api, sys, batch1, batch2)
5) Create a Mule Project and configure the properties to use the current Mule Domain project by Right Click -> Properties -> Mule Project
Command: $ su – dev_mule
Command: $ cd %MULE_HOME%/conf
Command: wrapper.java.additional.23=-Dmule.env=dev
Command: wrapper.java.additional.30=-Dmule.domain=sys
Command: $ ./mule restart
Command: $ sudo cp mule-domain-v1-1.0.0-SNAPSHOT-mule-domain.jar %MULE_HOME%/domains
Command: $ su – dev_mule
$ cd %MULE_HOME%/bin
$ ./mule restart
Command: $ cd %MULE_HOME%/logs
$ tail mule_ee.log
Here, we have demonstrated how the shared connectors work all through runtime of Mule domain projects. For more information, you can email us at [email protected] or visit www.royalcyber.com