Mule:Assigning objectstore 变量值到 flowVar

Mule:Assigning objectstore variable value to a flowVar

我必须维护在流中处理的消息计数(处理各种不同类型的消息)。为此目的使用 mule 对象存储扩展

<objectstore:config name="storeDownLoad" doc:name="ObjectStore"/>
<objectstore:store key="countA" value-ref="3" config-ref="storeDownLoad" />

如何为每个键值添加一个并将其重新分配给对象存储,以及如何在 flowVar 中检索该值。

看这里:https://github.com/mulesoft/mule-module-objectstore/blob/master/src/test/resources/mule-config.xml

它有检索对象存储值并将它们放入变量中的示例。请参阅 "retrieveVariable" 流程。或者,您可以将检索包装在 enricher 中。