我在看这个 SO question,但在这里我只希望 Caffeine 开始向 JMX 报告。
我已经添加了一个 application.conf 文件,并通过 -Dconfig.file 引用它:
caffeine.jcache {
# A named cache is configured by nesting a new definition under the caffeine.jcache namespace. The
# per-cache configuration is overlaid on top of the default configuration.
default {
# The monitoring configuration
monitoring {
# If JCache statistics should be recorded and externalized via JMX
statistics = true
# If the configuration should be externalized via JMX
management = true
}
}
它不起作用,但我怀疑它可能与 jcache 有关,但不确定实现此基本监控的预期方式是什么。