Deploying a mule application to a mule cluster using docker

616 Views Asked by At

I am kind of new to MULE ESB and deployments. I have been doing some trials around deploying mule application to a mule standalone . I am using an approach similar to this https://dzone.com/articles/dockerizing-clustering-and-queueing-up-with-mule-e

But my question is, if I have a mule cluster where in I deploy my mule proxies and also mule APIs , Is there any way to do that ? How would I bind individual docker images to the same mule cluster? Or If I have individual containers having mule runtime as mentioned in the above approach, How would I bind those containers into same cluster?

1

There are 1 best solutions below

0
On

Let's break down your questions one by one and let's try to answer it.

if I have a mule cluster where in I deploy my mule proxies and also mule APIs , Is there any way to do that ?

If you have Mule runtime prior to 3.8 version, you would need APi gateway to deploy your API proxy separately. But after Mule 3.8 version, Mulesoft has unified Mule runtime and API gateway, which means, your API proxy can be deployed directly into Mule runtime. You don't need separate API gateway for your proxy.
All the APIs, proxy and policies can be deployed into Mule runtime directly.
https://blogs.mulesoft.com/dev/mule-dev/announcing-mule-3-8-unified-runtime-integration-api-management/

How would I bind individual docker images to the same mule cluster? 

If you read the article carefully, you can see in Create a Mule Cluster in Docker section.
There are 2 properties config files for each cluster which defines the properties of each clusters, and the YAML file which binds both the runtime as a cluster.
This YAML file points out both the properties file which describe the properties of each cluster.

There is also a Docker image file that takes the previous base image (described at top FROM anirban-mule-demo) , creates the Mule runtime, and deploys the Mule application based on what is defined there.

When you use the command : docker-compose build the YAML file binds both the runtime build the Mule cluster within the Docker container. In the background the base image is run twice creating 2 different Mule runtime and then the cluster is created using the 2 properties config files describing each cluster properties with individual node.

It actually use the process of creating Mule cluster from properties file which is another way of using Mule cluster.
You can find the example how to create Mule cluster from properties file here

Now at the end you can use docker run command to start both the Mule runtimes in the cluster and the application inside it will be getting different http ports 7082 and 8082 respectively defined in docker run command.

Hope this help