【问题标题】:Infinispan server cache change encoding 'application/x-jboss-marshalling' to 'application/x-protostream'Infinispan 服务器缓存将编码“application/x-jboss-marshalling”更改为“application/x-protostream”
【发布时间】:2022-01-27 02:51:53
【问题描述】:

我目前在 JBoss 7.4 Standalone.xml 中配置了我的缓存容器,并在 localhost 上运行了 ISPN 远程服务器。一切都很好,直到它抛出错误:

ISPN000492:在“application/x-jboss-marshalling”到“application/x-protostream”之间找不到转码器

standalone.xml:

         <remote-cache-container name="remoteContainer" default-remote-cluster="data-grid-cluster">
            <property name="infinispan.client.hotrod.sasl_mechanism">SCRAM-SHA-512</property>
            <property name="infinispan.client.hotrod.auth_realm">default</property>
            <property name="infinispan.client.hotrod.auth_username">admin</property>
            <property name="infinispan.client.hotrod.auth_password">12345</property>
            <property name="infinispan.client.hotrod.client_intelligence">BASIC</property>
            <remote-clusters>
                <remote-cluster name="data-grid-cluster" socket-bindings="ispn1 ispn2"/>
            </remote-clusters>
        </remote-cache-container>

ISPN 缓存配置:

{ “分布式缓存”:{ “模式”:“同步”, “所有者”:2, “编码”:{ “钥匙”: { “媒体类型”:“应用程序/x-protostream” }, “价值”: { “媒体类型”:“应用程序/x-protostream” } }, “到期”:{ “寿命”:5000, “最大空闲”:1000 }, “统计”:真 } }

注意:我不想更改缓存编码,因为 infinispan Web 控制台停止工作

【问题讨论】:

    标签: caching marshalling infinispan hot-rod


    【解决方案1】:

    错误是说客户端缓存的媒体类型为application/x-jboss-marshalling,而您需要application/x-protostream

    查看 WildFly 23.x 代码,如果应用程序在其类路径中有 SerializationContextInitializer 实现,它将使用 ProtoStreamMarshaller(和媒体类型 application/x-protostream)。

    即使你只在缓存中存储字符串和原语,你仍然需要编写一个接口并用@AutoProtoSchemaBuilder注释它,以便RemoteCacheContainerConfigurationServiceConfigurator选择ProtoStreamMarshaller

    在 WildFly 24.x 中,自动检测机制发生了变化,如果模块属性包含 org.wildfly.clustering.web.hotrod,则选择 ProtoStreamMarshaller,因此 &lt;remote-cache-container modules="org.wildfly.clustering.web.hotrod"&gt; 可能也适用于 23.x。

    在 Wildfly 24.x 中,您始终可以将 &lt;remote-cache-container marshaller="PROTOSTREAM"&gt; 设置为手动选择 ProtoStreamMarshaller

    【讨论】:

      猜你喜欢
      • 2012-03-06
      • 2019-10-26
      • 1970-01-01
      • 1970-01-01
      • 2011-11-18
      • 1970-01-01
      • 2017-09-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多