Show Table of Contents
20.8.3. 配置重复 ID 缓存
服务器维护着发送到每个地址的
org.hornetq.core.message.impl.HDR_DUPLICATE_DETECTION_ID 属性值的缓存。每个地址也都维护着自己的地址缓存。
缓存的大小是固定的。缓存的最大尺寸可通过服务器配置文件(
standalone.xml 和 domain.xml)里的 id-cache-size 参数进行配置。这个参数的默认值是 2000 个元素。如果缓存最大尺寸为 N,那么存储的第 N+1 个 ID 将覆盖缓存里的第 0 个元素。
您也可以配置缓存是否持久化到磁盘。这可以用服务器配置文件(
standalone.xml 和 domain.xml)里的 persist-id-cache 参数来配置。如果这个值为 true,那么每个接收到的 ID 都会持久化到永久性存储里。它的默认值是 true。
注意
将复制 ID 缓存的大小设置为较大值可以确保重发的消息不会覆盖缓存里之前发送的消息。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.