top of page



Implementing Mapping Rules With MuleSoft Dedicated Load Balancer


Dedicated Load Balancer is an optional component within the Anypoint Platform and it is used to route the HTTP and HTTPS traffic to multiple applications deployed to CloudHub workers in the VPC.

To create a Dedicated Load Balancer, you must first create the Anypoint VPC which can be mapped to multiple environments and the same Dedicated Load Balancer can be used for different environments. You can use multiple DNSs for the same Dedicated Load Balancer (i.e. and

Applying Mapping Rules on a Dedicated Load Balancer (DLB)

Mapping rules are used on dedicated load balancers to translate input URI to call applications deployed on CloudHub. A pattern is a string that defines a template for matching an input text.

Whatever value is placed within curly brackets ({ }) is treated as a variable. Variable names can contain only lowercase letters (a-z) and no other characters, including slashes.

Let's consider that we have 2 DNS (i.e. and setup on a dedicated load balancer: is for the Dev environment whereas is for the Test environment.

Use Case 1

We are receiving requests on the DLB and need to redirect them to (the CloudHub application name will be org-ecommerce-api)

We can use this mapping rule to achieve this:

This previous rule will be applied when requests come on DLB and route to the CloudHub application in the VPC. (DLB)

is redirected to: (CloudHub)

Use Case 1

But here we have some problems that on our DLB, we have set up 2 DNSs, one for Dev and another for Test. Now, how will the DLB know this is a request that needs to route to either the Dev or Test application because the same rule will be applied for both?

To avoid this, we will be using a subdomain in the next use case.

Use Case 2

In this case, we will be using a subdomain for routing the request to the correct environment from DLB.

Our application name format must be org-app-subdomain (e.g. org-ecommerce-api-dev for dev environment and org-ecommerce-api-test for test environment) when deploying to CloudHub workers in VPC.

So, our mapping rule will look like this:

subdomain is a variable to map any subdomain.

1) dev environment (DLB)

is redirected to: (CloudHub Dev Environment)