Hi there Olivier.
It is hard to say what you are trying to do... but to answer your
question... The typical approach is to start a clientcache which spans
lifetime of the client application. It is not something that I would
want to start/stop as the mood strikes.
As for generic PdxSerializer vs Pojo specific serializer, I would error
on the side of Pojo specific serializer, as the serialization logic is
defined on the pojo. BUT if you don't want to "taint" your pojo with
serialization code, you could use a generic PDXSerializer. In this case
you can write your own or use the provided
ReflectionBasedAutoSerializer. [0]
So to *hopefully* answer your question. 1 clientcache, with either 1
generic PdxSerializer (custom or ReflectionAutoSerializer) or 2 pojo
specific PdxSerializable implementations.
--Udo
[0] -
https://geode.apache.org/docs/guide/developing/data_serialization/gemfire_pdx_serialization.html
On 3/28/17 10:47, Olivier NOUGUIER wrote:
Hi,
In a reactive extension to connect Apache Geode with akka-stream in
alpakka community project [0], I don't know how to use ClientCache in an
efficient way.
Given:
- 2 Pojos: Animal and Person
- 2 Regions for each
Should I use 2 ClientCaches with 2 custom PDXSerializer or only one
ClientCache with a more generic PDXSerializer ?
Another way to ask, if ClientCache is expensive to instanciate.
Thanks in advance.
PS: I've hesitate to post this on the user list...
[0]: https://github.com/cheleb/alpakka/tree/geode/geode