英文:
Can I configure Infinispan to use JavaSerializationMarshaller() on a specific cache and use protobufs on other caches?
问题
我试图从Infinispan 8.2.11.Final
升级到Infinispan 10.1.8.Final
。现在Infinispan默认使用协议缓冲。Infinispan缓存被Hibernate使用,并且还包含一些应用程序对象。
我可以设置全局marshaller如下:
holder.getGlobalConfigurationBuilder()
.serialization()
.marshaller( new JavaSerializationMarshaller() )
.whiteList().addClasses( CLASSES );
但是,如果我这样做,就需要将所有Hibernate类添加到白名单中(例如org.hibernate.cache.internal.CacheKeyImplementation
和其他类)。
是否可以在用于应用程序对象的缓存上设置marshaller,以便我可以继续为我的应用程序对象使用Java序列化,同时允许Hibernate使用protobuf?
英文:
I am attempting to upgrade from Infinispan 8.2.11.Final
to Infinispan 10.1.8.Final
. Infinispan now uses protocol buffers by default. The Infinispan cache is used by Hibernate and also contains some application objects.
I can set the global marshaller as follows:
holder.getGlobalConfigurationBuilder()
.serialization()
.marshaller( new JavaSerializationMarshaller() )
.whiteList().addClasses( CLASSES );
However, if I do this it will be necessary to whitelist all the hibernate classes (e.g. org.hibernate.cache.internal.CacheKeyImplementation
and others).
Is it possible to set the marshaller on the caches used for application objects so that I can continue to use Java serialization for my application objects while allowing Hibernate to use protobuf?
答案1
得分: 1
No. The marshaller is global to all caches.
You can add the Hibernate package to the white list by doing:
.whiteList().addRegexps("org\.hibernate.*");
Check for more info in Infinispan docs here and here.
offtopic: the last stable release is 11.0.1.Final.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论