7.7. Synchronous and Asynchronous Distribution
Distribution mode only supports synchronous communication. To elicit meaningful return values from certain public API methods, it is essential to use synchronized communication when using distribution mode.
Example 7.1. Communication Mode example
For example, with three caches in a cluster, cache
A
, B
and C
, and a key K
that maps cache A
to B
. Perform an operation on cluster C
that requires a return value, for example Cache.remove(K)
. To execute successfully, the operation must first synchronously forward the call to both cache A
and B
, and then wait for a result returned from either cache A
or B
. If asynchronous communication was used, the usefulness of the returned values cannot be guaranteed, despite the operation behaving as expected.