1

我最近在这里问了一个问题,我问如何从 Mule Flow 中引用 mule 注册表中的 String 对象。这已成功回答我当前的问题是在流程初始化之前我无法在注册表中填充它。

因此,在以下部分 (password="#app.registry['password']]) 中始终使用 null 并且我的连接失败:

<sfdc:config name="ConfigurableSalesforceConnection"username="${sfdc.username}"password="#app.registry['password']]"securityToken="${sfdc.securityToken}"doc:name="Salesforce" url="${sfdc.url}" />

除其他外,我还为我的流程添加了一个侦听器,但这添加的值太晚了,流程已经被初始化。

<notifications>
    <notification event="CONTEXT"/>
    <notification-listener ref="Initializer"/>
</notifications>
<spring:beans>
    <spring:bean id="Initializer" name="Initializer"
        class="initializer.InitAccountSync" />
</spring:beans>

我的问题由两部分组成,首先有没有办法在启动后重新初始化流程,和/或如何在所述初始化之前将值存储在 mule-context 注册表中?

提前致谢。

4

1 回答 1

1

注册表与 Spring 共享,您可以使用 SpEL 或 MethodInvokingFactoryBean 注册一些 java.lang.String bean。

但是,对于这种情况,如果您不在 mule 外部检索它,我建议您使用杠杆jasypt

于 2013-01-15T14:36:31.480 回答