Runtime-Patching in Mule 4
Explore runtime-patching in Mule 4.
Join the DZone community and get the full member experience.
Join For FreePatching in MUnit is different than how the Mule runtime is patched.
MUnit runs using the embedded container, which downloads all required dependencies to start a container based on a given version.
Here we need to understand minMuleVersion config defined in your mule-artifact.json. It defines your minimum runtime that is supported to run your Mule app and your Mule munit.
<properties>
<app.runtime>4.2.0</app.runtime> -- Mule App Runtime
</properties>
<plugin>
<groupId>com.mulesoft.munit.tools</groupId>
<artifactId>munit-maven-plugin</artifactId>
<version>${munit.version}</version>
<executions>
<execution>
<id>test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<runtimeVersion>4.1.5</runtimeVersion> -- Munit Runtime
</configuration>
</plugin>
You can switch your runtime (app/munit) anytime, but it should not be lower than minMuleVersion defined in your mule-artifact.json file.
By default, MUnit runs in the studio with the version of the project’s server. You can override this version by specifying the patched runtime version in the MUnit run configuration:
Menu-->Run --> Run Configurations
Under MUnit, select your MUnit test file.
Type the MUnit patched version you want to use in the Mule Runtime Version field, under Advanced Settings or here you can reload from plugin added to your pom.
Below is the error if you define your minMuleVersion to 4.2.0 and you are trying to deploy your code in 4.1.5
org.mule.runtime.api.exception.MuleRuntimeException: Artifact hello requires the newest runtime version. Artifact required version is 4.2.0 and Mule Runtime version is 4.1.5
INFO 2019-07-30 20:59:10,367 [WrapperListener_start_runner] org.mule.runtime.module.deployment.internal.StartupSummaryDeploymentListener:
**********************************************************************
* - - + DOMAIN + - - * - - + STATUS + - - *
**********************************************************************
* default * DEPLOYED *
**********************************************************************
*******************************************************************************************************
* - - + APPLICATION + - - * - - + DOMAIN + - - * - - + STATUS + - - *
*******************************************************************************************************
* hello * UNKNOWN * FAILED *
*******************************************************************************************************
Published at DZone with permission of Manish Kumar. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments