command-line-interfacemulemule4cloudhub

Anypoint cli v4 - how to deploy an application and ensure it continues to use Object store v2?


I am working on a Mule 4 api that needs to use Object store v2 . This api is being deployed to Cloudhub 2.0 .

whenever the application is deployed / redeployed the checkbox use objectStore v2 is getting unchecked . As a result when I am trying to retrieve data from object store , nothing comes up Though via Runtime manager can , Obsejctore link shows that the data is present in object store

so in this case I manually check the use objectStore v2 which restarts the api and now data in object store is accessible

So to prevent losing state for this checkbox on deployment was looking at this link: ( we use Anypoint cli v4 to deploy app )

Tried passing these properties : ( --objectStoreV1 [false] and also --property objectStoreV1:false )

However it did not work and post deployment the checkbox 'use objectStore v2' is again unchecked

any suggestions ?

anypoint-cli-v4 runtime-mgr:application:modify $EXISTING_APP_ID $COMMON_PARAMS --replicas 
$(REPLICAS) --artifactId $(ARTIFACT_ID) --assetVersion $(POM_VERSION) --groupId 
$(ANYPOINT_ORG) --replicas $(REPLICAS) --replicaSize $(REPLICA_SIZE) --runtimeVersion 
$(RUNTIME) --publicEndpoints $INTERNAL_PUBLIC_ENDPOINT --property 
mule.env:$CLOUDHUB_ENVIRONMENT --releaseChannel LTS 
--objectStoreV1 [false] --property objectStoreV1:false

Solution

  • The article that you are referring to is likely for an older version of Anypoint CLI. The correct flag is mentioned in the updated documentation for Anypoint CLI v4.

    Flag Description Example
    --[no-]objectStoreV2 Enables object store v2.Default: disabled --no-objectStoreV2

    If you want to use Object Store v2 you need to use --objectStoreV2. Also, I believe if you do not pass any flag it should persist the current state but this will make sure it is always deployed using object store v2 even if it was previously v1