Apache的骆驼:回复收到未知的correlationID [英] Apache Camel: Reply received for unknown correlationID

查看:287
本文介绍了Apache的骆驼:回复收到未知的correlationID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有在其他的两个软件组件中间件。在中间件我被 Apache的骆驼的Apache ActiveMQ的信息C>。

这是它如何工作的:


    中间件
  1. 1stComponent 用来发送邮件到 3rdComponent

  2. 3rdComponent 回复的消息,并将其返回到 1 (使用中间件)。

      1stComponent<< = GT;>中间件<< = GT;> 3rdComponent


问题:

我使用中间件 ConcurrentConsumers

在发送大量邮件顺序的,突然中间中间件停止所有的进程!
有没有例外情况或消息!
例如,第一个500的100的消息得到了处理,而余留在队列中未决消息。

,该警报的过程中的中间有时记录

  [WARN] TemporaryQueueReplyManager(骆驼(骆驼-1)线#11  -  TemporaryQueueReplyManager [Q.MyQ):91  - 回复收到未知的correlationID [c551c7aa061f501c。该消息将被忽略:ActiveMQMapMessage {commandId = 2161,responseRequired = TRUE,MESSAGEID = ID:XXXXXXX,originalDestination = NULL,originalTransactionId = NULL,producerId = ID:XXXXXXX,目的地=临时队列:// ID:localhost.localdomain- 40961-1389890357282-3:1:1,transactionId,有无=零,到期= 0,时间戳= 1389890272360,到达= 0,brokerInTime = 1389890272360,brokerOutTime = 1389890272360,的correlationID = c551c7aa061f501c,的replyTo =临时队列:// ID:本地。 LOCALDOMAIN-40961-1389890357282-3:1:1,持续性=真,类型=空,优先级= 4的GroupID = NULL,groupSequence = 0,targetConsumerId = NULL,COM pressed = false时,用户ID = NULL,内容=空,marshalledProperties = org.apache.activemq.util.ByteSequence@19e19da,数据结构= NULL,redeliveryCounter = 0,大小= 0,属性= {breadcrumbId = ID:XXXXXXXXXXXXXX,标题= 300,CamelJmsDeliveryMode = 1},readOnlyProperties = TRUE, readOnlyBody = TRUE,可弃= FALSE,jmsXGroupFirstForConsumer = FALSE} {ActiveMQMapMessage = theTable {}}

这是中间件 code:

 私有静态类MyRouteBuilder扩展RouteBuilder {
    @覆盖
    公共无效配置()抛出异常{
        从(ActiveMQ的:队列:Q.Middleware concurrentConsumers = 1&安培; maxConcurrentConsumers = 10)
        .threads(1,100)
            .process(新处理器(){
                公共无效过程(外汇兑换){
                    //一些code
                }
            })
        .inOut(activemq2:队列:Q.3RD)
        ;
    }
}

3rdComponent

 私有静态类MyRouteBuilder扩展RouteBuilder {
    @覆盖
    公共无效配置(){
        从(ActiveMQ的:队列:Q.3RD)
        .threads(1,100)
        .process(新处理器(){
            公共无效过程(外汇兑换){
                //一些code
            }
        })
        ;
    }
}


解决方案

更新:

我的previous答案工作正常,但没有完整的解决方案。

这个错误是的生产的非唯一 CorrelationIDs 的(随机字符串生成一个bug)简单! ! :|

There is a middleware in between of two other software components. In the middleware I'm routing Apache ActiveMQ messages by Apache Camel.

this is how it works:

  1. 1stComponent uses middleware to send message to the 3rdComponent
  2. 3rdComponent replies the message and sends it back to the 1st(using middleware).

               1stComponent <<=>> Middleware <<=>> 3rdComponent
    

Problem:

I'm using ConcurrentConsumers in middleware.

In the middle of sending a lot of messages sequentially, suddenly middleware stops all the process! there is no exceptions or messages! for example, first 100 of 500 messages got processed and the remainders remain in the queue as pending messages.

this warning is logged sometimes in the middle of the process:

[WARN ] TemporaryQueueReplyManager(Camel (camel-1) thread #11 - TemporaryQueueReplyManager[Q.MyQ]):91 - Reply received for unknown correlationID [c551c7aa061f501c]. The message will be ignored: ActiveMQMapMessage {commandId = 2161, responseRequired = true, messageId = ID:xxxxxxx, originalDestination = null, originalTransactionId = null, producerId = ID:xxxxxxx, destination = temp-queue://ID:localhost.localdomain-40961-1389890357282-3:1:1, transactionId = null, expiration = 0, timestamp = 1389890272360, arrival = 0, brokerInTime = 1389890272360, brokerOutTime = 1389890272360, correlationId = c551c7aa061f501c, replyTo = temp-queue://ID:localhost.localdomain-40961-1389890357282-3:1:1, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties = org.apache.activemq.util.ByteSequence@19e19da, dataStructure = null, redeliveryCounter = 0, size = 0, properties = {breadcrumbId=ID:xxxxxxxxxxxxxx, Title=300, CamelJmsDeliveryMode=1}, readOnlyProperties = true, readOnlyBody = true, droppable = false, jmsXGroupFirstForConsumer = false} ActiveMQMapMessage{ theTable = {} }

this is the middlewares Code:

private static class MyRouteBuilder extends RouteBuilder {
    @Override
    public void configure() throws Exception {
        from("activemq:queue:Q.Middleware?concurrentConsumers=1&maxConcurrentConsumers=10")
        .threads(1, 100)
            .process(new Processor() {
                public void process(Exchange exchange) {
                    //some code
                }
            })
        .inOut("activemq2:queue:Q.3RD")
        ;
    }
}

and the 3rdComponent:

private static class MyRouteBuilder extends RouteBuilder {
    @Override
    public void configure() {
        from("activemq:queue:Q.3RD")
        .threads(1, 100)
        .process(new Processor() {
            public void process(Exchange exchange) {
                //some code
            }
        })
        ;
    }
}

解决方案

UPDATE:

My previous answer is working correctly, but was not the complete solution.

The mistake was producing non-unique CorrelationIDs! (a bug in random string generators) simple!!! :|

这篇关于Apache的骆驼:回复收到未知的correlationID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆