Thanks clarifying this, I think “I know the client that did the operation does not get a subscription event from the server since the server knows the event came from that client” make some sense. But that means when I write a server with a geode backend, I have to handle this: server client A publish and server client B sub, from geode, there is only 1 client ( the server). so those event is not included. But client B need to know what client A published. Not hard to handle, but if geode provide this, save me a few lines of code ☺
Nan From: Darrel Schneider [mailto:[email protected]] Sent: Monday, August 21, 2017 11:26 AM To: [email protected] Subject: Re: geode can not publish and receive at the same region proxy? It may be that in the client that does the put it always triggers "afterCreate" instead of "afterUpdate" on the listener. I know the client that did the operation does not get a subscription event from the server since the server knows the event came from that client. Also I think since the client proxy is always empty it will always look like a create event to it even if it turns out to be an update to an existing key on the server. If you had a caching proxy then the client in which the operation originates may already have the entry so it could be afterCreate or afterUpdate (update if it has that key stored locally). But the non-caching proxies never store anything locally and that is why it would always look like a create. For events forwarded from a server due to a subscription I think we use the server state to decide what type of event to deliver to the client. I'm not sure about all of this so do some further testing but I hope this helps you proceed. On Mon, Aug 21, 2017 at 7:53 AM, Xu, Nan <[email protected]<mailto:[email protected]>> wrote: hi, Question about geode streaming. I have a client proxy region local created this way. ClientCacheFactory cacheFactory = new ClientCacheFactory(); cacheFactory.addPoolLocator(xxx,yyy); cacheFactory.setPoolMinConnections(4) .setPoolSubscriptionEnabled(true) .setPoolThreadLocalConnections((Boolean)GeodeConfig.getInstance().getConfig().get("pool-threadlocal-connection")); ClientCache clientCache = cacheFactory.create(); ClientRegionFactory<String, byte[]> regionFactory = clientCache.createClientRegionFactory(ClientRegionShortcut.PROXY); region = regionFactory.addCacheListener(cacheListener).create("rep_region"); and my listerner. public class SimpleCacheListener extends CacheListenerAdapter { @Override public void afterUpdate(EntryEvent event) { processor.addEvent(event); } } When I use this region put and listener at different JVM, everything works fine. The afterUpdate get triggered, but when I use the same region but pub and sub at one JVM (different thread), the callback not get triggered at all. Is there a setting for it? and reasoning for this? Thanks, Nan ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message. ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message.
