-
Notifications
You must be signed in to change notification settings - Fork 685
[3.5 M1][CORE] Mule Container Resources
Jira:
Forum discussion:
Several mule users have requested the capability to share resources between applications that are deployed within the same container. The main reason for the request is that they want to create an application that is a composition of mule applications. This allow them to have different teams working independently.
Another request is the capability of consuming services between mule applications deployed in the same container using VM. This allow mule applications to make use of services deployed in other mule applications in a really easy and performant way.
We are going to provide such capabilities through the definition of resources at the container level and exposing them to all the applications deployed in the container.
As an architect I have different teams working on different parts of an applications. I want them to work as independent units but they must:
- share the same security mechanism
- all the services must be provided through the same port
- share the connection to the persistent storage
- share services between each other through a well defined interface
Provide an xml configuration file at the domain level in which users can define the mule components that they want to share between mule applications. Components defined in this file can be referenced from a mule application that belongs to that domain and make use of it.
A file located named mule-domain-config.xml located in a jar file in the domain will contain the configuration for shared resources
<mule-domain-config>
<http:connector name="ApiConnector"/>
</mule-domain-config>
Any mule application within that domain can make use of the shared connector by just reference it from the configuration
<mule>
<flow name="httpService">
<http:inbound-endpoint host="localhost" port="8080" connector-ref="ApiConnector"/>
<set-payload value="#['success']" />
</flow>
</mule>
A maven artifact for creating domain configuration will be created. Such artifact must contain:
- Domain specification
- Domain shared classes and files
- Domain configuration with shared resources
This artifact can easily be used as dependencies in Maven by those applications that belong to that domain. That allows to:
- Versioning of domain configuration
- Relate mule application with specific domain configuration version
- Run mule application test cases including domain configuration
- Use of profiles for using different domain configurations for different environemnts
- Identify within studio to which domain an application belongs and during deployment of the application also deploy the domain resources
- Create a deployable archive that can be deployed in mule as a domain by dropping the file to lib/domain or by using MMC
A maven artifact for creating a complete domain deployment archive. Such artifact can contain:
- The domain deployable archive
- The set of applications that belong to the domain
This will allow to deploy a complete domain to a mule container including the domain configuration and domain apps. Such artifact can be used to work in studio with a complete domain in the workspace.
- HTTP connectors
- VM connectors
- Security Managers
- TBD ???
Mule domain configuration
- If there's a jar containing a mule-domain-config.xml file it must created shared resources ONLY for the applications within that domain
- If there's more than one mule-domain-config.xml file in the jars of a domain then that domain deployment and all the applications related to that domain must fail.
Http connector sharing
- Different applications must be able to share the same port
- Different applications can't be configured to use the same host port path combination. When they do the last one to be deployed must fail
VM connector sharing
- When using a shared connector it must be possible to send message between mule applications
- There can't be two applications using the same vm queue path
Security Manager sharing
- It must be possible to define a security manager at the container level and reference it from the mule applications
- ???? We may need to add the possibility of having more than one security manager per application
We need to take into consideration that with the current threading implementation we are going to start reusing thread across different applications.
We need to find a way to, for every applications, allow the definition of the container shared resources file so Studio can load it when it deploys the application.
We can also think of creating a new project structure that represents the set of applications that belongs to the same container and the file with the shared resources.
We must add support for the shared resources and show it status as we currently do for connectors.
Initially there's no impact since CH only uses one application for AMI and by default there will be no shared resources.
No impact.
No impact yet.
Requires a new documentation section for this functionality.