Steve
Steve

Reputation: 55555

@Async and @Cacheable Caching Non-Null Response

If I have a method marked as @Async as well as @Cacheable, will the condition of not caching the result when null work (considering it is returning a Future) ?

@Async 
@Cacheable(unless = "#result == null")
public ListenableFuture<ContentSet> doSomething(){}

Upvotes: 2

Views: 1000

Answers (1)

Stephane Nicoll
Stephane Nicoll

Reputation: 33091

Check SPR-12967. Such return types are not supported.

Upvotes: 3

Related Questions