gpt4 book ai didi

java - ExchangeTimedOutException : The OUT message was not received

转载 作者:行者123 更新时间:2023-11-30 03:37:09 27 4
gpt4 key购买 nike

我在与 aciveMq 一起使用的 InOnly 交换模式时遇到问题。

我编写了一个在 ServiceMix 中运行的模块。它工作正常,只是它将每条消息发送到死信队列(ActiveMQ.DLQ)。如果我检查该消息,则 dlqDeliveryFailureCause 包含此消息:java.lang.Throwable:消息已过期。

我检查了 JMSExpiration = 0。

路线:

    from("direct:" + reqOutQueue).id("reqInEnritch")
.log("Start dispatch")
.setExchangePattern(ExchangePattern.InOnly)
.recipientList().method(EsbDynamicRouter.class, "systemRoute").parallelProcessing();

函数,返回端点列表:

@RecipientList
public String[] systemRoute(@Body Object body) throws Exception
{
String[] result = null;

List<DispConfView> targetList;
int cikl = 0;
SystemQueueHelper systemInfo;
MessageHeaderHelper msgHeadHelp = new MessageHeaderHelper(body);

// The object contains the affected elements
targetList = dispHelp.getDispConfByMsgType(msgHeadHelp.getMsgType());

result = new String[targetList.size()];

for (DispConfView element : targetList)
{
// It builds the target andpoints
systemInfo = new SystemQueueHelper(element.getSystemCode(), null, msgHeadHelp.getDirection());

result[cikl] = systemInfo.getQueuName();

cikl++;
}

return result;
}

该列表包含以下值:

activemq:queue:ERP.req.in?exchangePattern=InOnly
activemq:queue:WF.req.in?exchangePattern=InOnly

如您所见,我尝试设置正确的模式,但每条消息都会进入死信队列。

请帮忙,我必须设置什么!

谢谢!

最佳答案

解决办法:它可以在上下文文件中设置:

<!-- JMS configuration -->  
<bean id="pooledJmsConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start" destroy-method="stop">
<property name="maxConnections" value="1" />
<property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>

<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="failover:(tcp://localhost:61616)" />
<property name="redeliveryPolicy">
<bean class="org.apache.activemq.RedeliveryPolicy">
<property name="maximumRedeliveries" value="5"/>
</bean>
</property>
</bean>

<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="pooledJmsConnectionFactory"/>
<property name="cacheLevelName" value="CACHE_CONSUMER" />
<property name="disableReplyTo" value="true" />
</bean>

“jmsConfig bean”“diasbleReplayTo”属性解决了问题。

关于java - ExchangeTimedOutException : The OUT message was not received,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27582010/

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