The objective of this article is to provide you with an example on how to use Cache Scope in a multi worker Cloudhub implementation.
If you run the Cache Scope out of the box, each worker will have a in-memory cache, but if you want to share the cache between workers, we need to use Object Store v2 Cloudhub implementation, and this is how...
1) Import the Mule 4 project attached to this case
Example API: Mule4Project.jar
2) You may deploy this in Cloudhub with Object Store v2 but you may also run it on Studio to understand what it does
3) In the case of Studio, please run the following cURL command to execute the flow
curl http://localhost:8081\?number\=1
Note: In this case, we used the "number" queryParam as the object store key to store the value, please make sure to understand what the key is, since that configuration might affect how the cache scope works and you may end with a cache scope never being used as cache.
Disclaimer 1: This example is provided as a reference for your own usage and is not to be considered a MuleSoft product. This example should be considered as a custom solution. The custom solution is not a Supported MuleSoft product.
Disclaimer 2: This solution provides a suggestion that should be considered in conjunction with your specific use-case and requirements and does not represent a complete solution for all circumstances.
001117143

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.