Can I configure Infinispan to use JavaSerializationMarshaller() on a specific cache and use protobufs on other caches?

huangapple go评论72阅读模式
英文:

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.

英文:

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.

huangapple
  • 本文由 发表于 2020年7月29日 13:02:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/63146638.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定