由于某种原因,当传递的消息总是落后于实际发送时,我经常遇到队列释放问题。James 设置为将传入消息发送到网关 (Postfix)。
RemoteDelivery 类具有:
// Set it to try to deliver (in a separate thread) immediately
// (triggered by storage)
究竟什么是“存储”以及在哪里配置?
我设置了一个 mailet,它将匹配的消息(基于收件人域)发送到网关(在 mailetcontainer 中指定)。在它被“卡住”以传送到网关之前,这一直很好。在 James 日志中,它显示为Successfully spooled mail
来自发件人,然后显示为
[TID=83] INFO 11:04:54,858 | james.smtpserver | Id='1510412390' User='' Successfully spooled mail Mail1581005094857-978ba32f-74e6-4ca1-b903-7994637a9873 from <address@remote> on <remote sender IP> for [<address@local>]
...
[TID=734] INFO 11:04:55,290 | james.mailetcontext | Remotely delivering mail Mail1581005094857-978ba32f-74e6-4ca1-b903-7994637a9873
[TID=34] INFO 11:04:55,290 | james.mailetcontext | Remote delivery thread (0) will process mail Mail1581005072858-90055113-03cf-4bc0-84d7-d47d176feef2
[TID=34] INFO 11:04:55,290 | james.mailetcontext | Attempting to deliver Mail1581005072858-90055113-03cf-4bc0-84d7-d47d176feef2
[TID=734] INFO 11:04:55,312 | james.mailetcontext | Adding SMTP gateway: <gateway address>
[TID=734] INFO 11:04:55,312 | james.mailetcontext | Sending mail to [<address@local>] via [<gateway address>]
[TID=34] INFO 11:04:55,312 | james.mailetcontext | Adding SMTP gateway: <gateway adrdress>
[TID=34] INFO 11:04:55,312 | james.mailetcontext | Attempting delivery of Mail1581005072858-90055113-03cf-4bc0-84d7-d47d176feef2 to host <gateway adrdress> at <gateway adrdress> from <address@remote> for addresses [<address@local>]]
但我没有看到邮件已成功发送到网关。
为了让它“解开”,我需要将另一条传入消息发送给 James,该消息将命中同一个 mailet 以推送之前被卡住的假脱机消息。然后在詹姆斯日志中它将显示为
[TID=35] INFO 11:22:14,443 | james.mailetcontext | Mail (Mail1581005094857-978ba32f-74e6-4ca1-b903-7994637a9873) sent successfully to <gateway adrdress> at <gateway adrdress> from <address@remote> for [[<address@local>]]
看起来,如果中继主机发生变化,相关队列就会开始表现不同,就像一个纸巾管,里面有乒乓球。只有当足够多的球被推入时,才能从另一端取出一个。对此有什么想法吗?
ActiveMQ ver 5.4.2 出现了问题。升级到 5.5.1,队列问题消失了。