I'm using a singleton bean to hold certain "static data" that is evaluated at the API start and may get updated from time to time.
I'm setting the bean initially as a map in the context:
<util:map id="staticData" key-type="java.lang.String" >
<entry key="keyA" value="#{null}" />
<entry key="keyB" value="#{null}" />
</util:map>
The staticData values are then updated periodically. For the updates, I'm currently using header-enricher, for lack of a better idea.
<int:header-enricher>
<si:header name="dummyHeader" expression="@staticData.put('keyA', payload)" />
</int:header-enricher>
This "works" but seems inelegant and also creates a dummyHeader with no utility.
Would you recommend a better approach to this mechanism?
Thanks for any pointers and best regards