拦截消息过期
Intercept message expiration
有没有办法捕捉消息过期?
我 found 传入和传出消息的拦截器(remoting-incoming-interceptors
和 remoting-outgoing-interceptors
),但我没有找到到期时间。
远程拦截器仅用于拦截客户端和代理之间特定于协议的input/output。你需要的是一个broker plugin. Specifically, you need to implement ActiveMQServerMessagePlugin#messageExpired(MessageReference, SimpleString, ServerConsumer)
。当消息过期时,您的插件将被调用。
当然,更直接的方法是在队列上绑定一个监听器到过期地址,当消息过期时将调用该监听器。