<int-http:outbound-gateway> <int-http:request-handler-advice-chain> <cache:advice> <cache:caching cache="cacheKey"> <cache:cacheable method="handle*Message" key="#a0.payload.id"/> </cache:caching> </cache:advice> </int-http:request-handler-advice-chain> </int-http:outbound-gateway>
You might see above that handle*Message will be considered by Spring Cache Advice to invoke cache functionality. To be more specific we are thinking about handleRequestMessage method and it's parameters defined as a part of HttpRequestExecutingMessageHandler which will be considered as a key - id in our case. Moreover you need to define explicitly cacheManager bean and define key for cache entry (cacheKey in our case) using for instance EhCache.
References : [1] Spring Integration - Cache for inbound/outbound gateway
No comments:
Post a Comment