Search code examples
wso2wso2-esbwso2-enterprise-integratorwso2-micro-integrator

WSO2 MI: how to delete registry scope property?


I am working with wso2mi-4.1.0. Following this guideline property-Mediator I have created property with scope="registry"

<property expression="concat('Hello','world')" name="var1" scope="registry" type="STRING"/>

It works fine. I can read that and work with that. Also I can see var1 file in %MI_HOME%\registry\governance. Now I need to delete this registry property. I am trying to do that:

 <property name="var1" action="remove" scope="registry" />

But it doesn't work.

Could you please suggest me how to remove registry scope property?

Thank you


Solution

  • You can't remove registry resources with the property mediator. There seems to be no implementation to support this in the source.

    As a workaround try using the script mediator for this.

    <script language="js"><![CDATA[
        mc.getConfiguration().getRegistry().delete("gov:/some/path/something.xml");
    ]]></script>