gpt4 book ai didi

apache-camel - 故障转移负载均衡器中的死锁

转载 作者:行者123 更新时间:2023-12-04 05:15:01 24 4
gpt4 key购买 nike

同时用多个线程调用下面的路由,当消息超时时,我遇到了死锁。这个问题有解决方法吗?还是我错误地配置了故障转移?

我创建了一个简单的项目来演示这个问题: https://github.com/leechinkong/CamelFailoverLoadbalancer

from("direct:test")
.loadBalance()
.failover(3, true, true)
.inOut("jms:testRqQueue1?replyTo=testRsQueue1&useMessageIDAsCorrelationID=true","jms:testRqQueue2?replyTo=testRsQueue2&useMessageIDAsCorrelationID=true");

线程转储:

"Camel (camel-1) thread #0 - JmsReplyManagerTimeoutChecker[testRsQueue1]":
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007aca28f60> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:867)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1197)
at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:214)
at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:290)
at org.apache.camel.support.DefaultTimeoutMap.putIfAbsent(DefaultTimeoutMap.java:116)
at org.apache.camel.component.jms.reply.CorrelationTimeoutMap.putIfAbsent(CorrelationTimeoutMap.java:108)
at org.apache.camel.component.jms.reply.ReplyManagerSupport.registerReply(ReplyManagerSupport.java:105)
at org.apache.camel.component.jms.JmsProducer$1.createMessage(JmsProducer.java:227)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:282)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:225)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$1.doInJms(JmsConfiguration.java:239)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:493)
at org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:236)
at org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:409)
at org.apache.camel.component.jms.JmsProducer.processInOut(JmsProducer.java:239)
at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:150)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91)
at org.apache.camel.builder.NoErrorHandlerBuilder$1.process(NoErrorHandlerBuilder.java:40)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
at org.apache.camel.processor.FatalFallbackErrorHandler.process(FatalFallbackErrorHandler.java:49)
at org.apache.camel.processor.RedeliveryErrorHandler.deliverToFailureProcessor(RedeliveryErrorHandler.java:896)
at org.apache.camel.processor.RedeliveryErrorHandler.processAsyncErrorHandler(RedeliveryErrorHandler.java:561)
at org.apache.camel.processor.RedeliveryErrorHandler$1.done(RedeliveryErrorHandler.java:466)
at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:86)
at org.apache.camel.processor.SendProcessor$1.done(SendProcessor.java:139)
at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:250)
at org.apache.camel.processor.Pipeline$1.done(Pipeline.java:145)
at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:250)
at org.apache.camel.builder.NoErrorHandlerBuilder$1$1.done(NoErrorHandlerBuilder.java:44)
at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:86)
at org.apache.camel.processor.SendProcessor$1.done(SendProcessor.java:139)
at org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:179)
at org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onTimeout(TemporaryQueueReplyHandler.java:61)
at org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:54)
at org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:30)
at org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:230)
at org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:180)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

Found 1 deadlock.

最佳答案

与 Camel 一起长大:https://issues.apache.org/jira/browse/CAMEL-9994

问题已在 2.17.2/2.18.0 中修复

关于apache-camel - 故障转移负载均衡器中的死锁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37393957/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com