使用来自数据库消息的骆驼启用重播机制 [英] Enabling Replay mechanism with camel from messages from DB

查看:23
本文介绍了使用来自数据库消息的骆驼启用重播机制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用骆驼实现重放机制,即,我将不得不检索所有已经持久化的消息并转发到适当的骆驼路由进行重新处理.这将由石英调度程序触发.

Iam trying to implement replay mechanisam with camel ie., i will have to retrieve all the messages already persisted and forward to appropriate camel route to reprocess.This will be triggred by quartz scheduler.

我使用下面的方法实现了相同的效果.

I achieved the same by using below.

1) 一旦石英调度器被触发,转发到处理器,它将查询 db 并将消息作为列表,并在骆驼交换属性中将其设置为列表.2)使用骆驼,其中 LoopProcessor 将在交换中的迭代中设置适当的 xml.3)将它转发到activemq,它将被转发到适当的骆驼路线进行重新处理.一切安好.我看到以下两个问题a)可能有n"个消息(10,000+),它们将以列表的形式在骆驼交换属性中可用 - 我可以删除发送进行处理的消息,但我认为这对性能会更好和内存使用情况.

1) once the quartz scheduler is triggered, fwd to processor which will query db and have the message as list and set the same in camel exchange properties as list. 2) Use the camel in which LoopProcessor will set appropriate xml in the iteration in the exchange. 3) fwd it to activemq which will be forwarded to appropriate camel route to reprocess. Every thing is fine. I see the following TWO issues a) there might be 'n' number of msges(10,000+) which will be available in the camel exchange properties in the form of List - i can remove the message which is sent for processing but i think this will do more good on performance and memory usage.

b) 我不想将所有 10,000 多条消息转发到 activemq,我想这会使其详尽无遗.是否有更好的机制将 10000 多条消息转发到 activemq.-- 我正在考虑使用 SEDA/VM(使用不同的骆驼上下文).考虑到上述问题,这对我来说有多好.

b) I don want to forward all the 10,000+ messages to activemq which i guess will make it exhaustive. Is there a better mechanism to forward 10000+ messages to activemq. -- I am thinking to use SEDA/VM(using different camel contexts).how good this can give me considering above questions.

谢谢.

问候森蒂尔·库马尔·塞卡尔

Regards Senthil Kumar Sekar

推荐答案

如果消息数量有问题,则不应一次加载所有消息.

If the number of messages is a problem, then not all messages should be loaded at once.

流程如下(另请参阅我对您的其他SO):

Process as follows (see also my answer for your other SO):

  1. 限制查询数据库时的结果数.
  2. 为已处理的数据库条目设置标记(例如 processedFlag)
  3. 从 1. 开始,仅查询尚未处理的条目,直到处理完所有记录.

但是,如果 10,000 多条消息确实存在问题,您也应该测试 ActiveMQ 方法.

However, you should test the ActiveMQ approach as well, if 10,000+ messages are really a problem or not.

这篇关于使用来自数据库消息的骆驼启用重播机制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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