To implement a write-behind cache listener. First step is configure gateway hub with no incoming port specification and gateway with no endpoint. Inside gateway you define gateway listener which will be used for write-behind functionality. Events for this listener are queued and delivered in batched List to this listener processEvent method. Second step is to enable gateway queueing for the regions whose events you want to handle:
Your XML configuration should looks like this:
Code:
<cache>
<gateway-hub id="DB">
<gateway id="DB">
<gateway-listener>
<class-name>MyGatewayListener</class-name>
</gateway-listener>
<gateway-queue ... />
</gateway>
</gateway-hub>
...
<region name="data">
<region-attributes enable-gateway="true"/>
</region>
...
</cache>
I hope it's help you.
--
Kiril Menshikov
Data Grid Architect at Mirantis