Hi Mateusz,

The issue is not related to CQ functionality, its related to serialization and 
de-serialization of the PDX type.

As you can see from documentation, you need to configure distributed Ids in 
each cluster to get the PDX working across the WAN sites.

https://geode.apache.org/docs/guide/110/developing/data_serialization/use_pdx_high_level_steps.html

Have you configured the cluster sites with unique distributed ids?

-Anil.



From: Mateusz Rys <razama...@gmail.com>
Reply-To: "user@geode.apache.org" <user@geode.apache.org>
Date: Monday, June 29, 2020 at 2:26 AM
To: "user@geode.apache.org" <user@geode.apache.org>
Subject: CQ Event Notification in Multisite (WAN)

Hi Geode Users,

Together with my friends I'm trying to setup a simple Native Client (C++) and 
Server configuration.
We decided to use Continuous Query (CQ) and overwrite onEvent() method to have 
an easy way to be informed about the updates in the database.
So far so good, everything works as expected.

But the main reason we are doing all of this is to have two or more such setups 
- all connected using Geode Multisite (WAN).
We successfully created Multisite configuration, we can see (with gfsh 
commands) that if something is written to SiteA, it is being replicated to 
SiteB.
After reading the documentation, it also became obvious that we must provide a 
way to serialize objects before they are sent over the network.
We decided that the simplest way should be to inherit from PdxSerializable 
class.

Unfortunately, we ran into a problem that we can't get rid of:
[error 2020/06/25 16:44:36.344952 CEST geodeA:3604 139864301352704] Exception 
while receiving subscription event for endpoint geodeB:40404::
apache::geode::client::IllegalStateException: Unregistered type in 
deserialization

The exception is visible if the event comes from a remote (SiteB) source.
If we update the database locally on SiteA we have normal onEvent() invocation 
in ClientA,
but the exception is present on ClientB connected to SiteB.

We register our type using 
cache.getTypeRegistry().registerPdxType(Order::createDeserializable);
We tried to have only the first client to register the type, only the second 
client, or both of them, but that didn't seem to change anything.
We also tried to toy with setPdxReadSerialized(true) but to no avail.

Have you met this exception before?
Do you have any CQ+Multisite implementation examples?


Thank you
Regards
Mateusz

Reply via email to