1 of 1 people found this helpful
It depends, but if the listener is fired on the primary owner then there is no difference.
If however you are using clustered listeners or aren't using the primaryOnly setting on the listener then the first would be the most perfomant given that you don't have to serialize the value as a response a second time, for no owner nodes. However you have to be careful with modifying the cache inside a listener. As mentioned at Listener (Infinispan JavaDoc All 9.4.0.Final API) the event is notified while holding the lock to the entry and thus you can delay or possibly deadlock operations by doing so. You can set your listener to not be sync or use your own thread pool to avoid this issue if it is a problem.
thanks for reply sir