salesforcemulemulesoftmule4

Mule 4 sfdc connector - force reconnection or even lazy loading of connection is it possible?


Here are the details of connector:

<salesforce:sfdc-config name="MySFDC_Connector" fetchAllApexRestMetadata="true" readTimeout="30">
        <salesforce:jwt-connection consumerKey="myKey" tokenEndpoint="myUrl" 
        keyStore="myCertLocation/SFDC.jks" storePassword="myPassword" 
        principal="myUser" connectionTimeout="30" certificateAlias="myAlias" loginRequestTimeout="30">
            <reconnection><reconnect/></reconnection>
        </salesforce:jwt-connection>
    </salesforce:sfdc-config>

Keystore refers to the JKS file located within my src\main\resources\myCertLocation folder Everything works fine . However when ever we need to make a change in the JKS file ( annually ) we need to commit this file again , do a build and deploy to prod . So a lot of overhead...

Is there a way we could dynamically replace the JKS file whenever it is time to change it . ( like maybe store it in a data repository / s3 bucket / external file location etc etc ) and refer to it ? what I have observed is that this JKS file needs to be found and valid on Mule application startup . Is there a way to dynamically change this file and force Mule to reinitialise the connector maybe ? ( without an application restart )

Using Mule 4.x EE


Solution

  • Short answer: no. The file must be available at startup as you noticed, and also has to be in the classpath, ie inside the application jar file or in a separate file. Other repositories will not work as far as I know.