我的配置是:
我的应用程序正在通过Spring JmsTemplate.convertAndSend
方法发送消息:
import org.springframework.jms.core.JmsTemplate;
@Component
@Slf4j
public class AsynchronousMajProducer {
@Autowired
private ActiveMQConfig activeMQConfig;
@Autowired
private JmsTemplate jmsTemplate;
private void convertAndSend(String msg) {
jmsTemplate.convertAndSend(activeMQConfig.privateQueue(), msg, message -> {
String[] versionParts = buildProperties.getVersion().split("\\.");
String version = versionParts[0] + "." + versionParts[1];
message.setStringProperty("VERSION", version);
message.setLongProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY, 2000);
return message;
});
}
}
[长时间运行(数周)后,某些队列不再使消息入队(有些工作正常)。
对于那些失败的方法,convertAndSend方法不会引发任何异常,一切似乎都可以,但是最后,什么都没有入队...(AMQ控制台上的入队数从不增加)。
下面是成功发送的AMQ日志:
2019-11-22 09:37:29,647 | INFO | Sending message: ActiveMQTextMessage {commandId = 8, responseRequired = false,
messageId = ID:NMI16510-60675-1574375565048-1:23:2:1:1, originalDestination = null, originalTransactionId = null,
producerId = ID:NMI16510-60675-1574375565048-1:23:2:1, destination = queue://testportail,
transactionId = XID:[1096044365,globalId=3137322e31372e36352e37372e746d313537343337353834383839343030343731,
branchId=3137322e31372e36352e37372e746d343732], expiration = 1574375885026, timestamp = 1574375849026,
arrival = 0, brokerInTime = 0, brokerOutTime = 0, correlationId = null, replyTo = null, persistent =
true, type = null, priority = 9, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false,
userID = null, content = org.apache.activemq.util.ByteSequence@15d17509, marshalledProperties = org.apache.activemq.util.ByteSequence@34beb533,
dataStructure = null, redeliveryCounter = 0, size = 1122, properties = {VERSION=2.0, AMQ_SCHEDULED_DELAY=2000},
readOnlyProperties = false, readOnlyBody = false, droppable = false, jmsXGroupFirstForConsumer = false,
text = {
"type" : "MAJ_CONTACT",
"id" : 124
}} | org.apache.activemq.broker.util.LoggingBrokerPlugin | ActiveMQ Transport: tcp:///172.17.65.77:61220@61611
2019-11-22 09:37:32,001 | DEBUG | Firing: Job [id=ID:NMI16510-60675-1574375565048-1:23:2:1:1, startTime=Fri Nov 22 09:37:30 NCT 2019,
delay=2000, period=0, repeat=0, nextTime=Fri Nov 22 09:37:32 NCT 2019, executionCount = 1] | org.apache.activemq.store.kahadb.scheduler.JobSchedulerImpl
| JobScheduler:JMS
2019-11-22 09:37:32,002 | DEBUG | Set message ID:NMI16510-60675-1574375565048-1:23:2:1:1 timestamp from 1574375849026 to 1574375852002
| org.apache.activemq.broker.scheduler.SchedulerBroker | JobScheduler:JMS
2019-11-22 09:37:32,003 | DEBUG | ACTIVEMQ Message ID:NMI16510-60675-1574375565048-1:23:2:1:1 sent to queue://testportail
| org.apache.activemq.broker.region.Queue | JobScheduler:JMS
[失败时,我只会得到第一个日志Sending message
。AMQ日志上没有错误或警告消息。我注意到有些队列受到影响,有些则没有。
要'解决'问题,我必须:
/apache-activemq-5.15.1/data/ACTIVEMQ/scheduler
在生产中,我们每天都会这样做以预见此问题。这不是一个好的解决方案,因为先前由应用程序发送但未排队的消息肯定会丢失。
这是AMQ调度程序的已知问题吗?经常重新启动AMQ是一种不好的/好的做法吗?
Original
<storeUsage>
<storeUsage limit="100 gb"/>
</storeUsage>
<tempUsage>
<tempUsage limit="50 gb"/>
</tempUsage>
Modification
<storeUsage>
<storeUsage limit="20 mb"/>
</storeUsage>
<tempUsage>
<tempUsage limit="20 mb"/>
</tempUsage>
问题是kahadb wich的存储问题比100Go小。谢谢你!