import com.hazelcast.map.listener.EntryUpdatedListener;
...
public class DataTable<E> implements EntryUpdatedListener<E, Entity> {
...
public void entryUpdated(EntryEvent<E, Entity> event) {
Entity updatedEntity = event.getValue();
Entity originalEntity = event.getOldValue();
System.out.println(updatedEntity); // Service: dataServer LastUpdated: 2016-07-07 15:34:14.796
System.out.println(originalEntity); // null
}Hi,
how do you register your entry listener? The following listener works fine in Hazelcast 3.6.4, I can see both old and new value when updating an entry either via map.put or map.replace:
map.addEntryListener(new EntryUpdatedListener<Integer, String>() { @Override public void entryUpdated(EntryEvent<Integer, String> event) { System.out.println("old val: " + event.getOldValue() + ", new val: " + event.getValue()); } }, true);Cheers!
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/c3ebd3b0-abb2-447a-9ff0-48753580cdfd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Config config = getHazelcast().getConfig();
MapConfig mapConfig = config.getMapConfig(name);
mapConfig.setMaxIdleSeconds(0);
mapConfig.setTimeToLiveSeconds(0);
mapConfig.setEvictionPolicy(EvictionPolicy.NONE);
mapConfig.setBackupCount(3);
hazelcast.getMap(name).addEntryListener(this, true);Warning:
This method breaks the contract of EntryListener. When an entry is updated by set(), it fires an EntryEvent with a null oldValue.
--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+unsubscribe@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/a8d0c35f-ff98-45d2-a422-d3da0d23450d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/a8d0c35f-ff98-45d2-a422-d3da0d23450d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.