从DB消息允许骆驼重播机制 [英] Enabling Replay mechanism with camel from messages from DB

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

问题描述

荫试图实现与骆驼即重播mechanisam,我将不得不检索所有消息已经坚持并转发到相应的骆驼路线reprocess.This将石英调度程序triggred。

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)一旦石英调度被触发,转送到处理器,将查询数据库,并有消息作为列表并设置在骆驼交换属性列表相同。
2)使用其中LoopProcessor将在交换迭代设置适当的XML骆驼。
3)它FWD到将被转发到相应的骆驼航线重新处理的ActiveMQ。
一切安好。
我看到下面的两个问题
A)有可能是'N'msges数(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.

二)我不希望所有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.

感谢。

问候
Senthil库马尔谢卡尔

Regards Senthil Kumar Sekar

推荐答案

如果消息的数量是一个问题,那么不是所有的消息应在加载一次。

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

流程如下(见我送给你的其他回答<一个href=\"http://stackoverflow.com/questions/22515018/fetch-specific-set-of-records-for-each-poll-without-setting-the-flag-in-camel?lq=1\">SO):

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


  1. 查询数据库时,限制的结果数量。

  2. 设置一个标记(例如 processedFlag )对于那些处理DB项

  3. 开始以1和查询只是尚未处理的条目,直到所有的记录都处理。

  1. Limit the number of results when querying the DB.
  2. Set a marker (e.g. processedFlag) for the DB entries that are processed
  3. Begin at 1. and query only the not already processed entries until all records are processed.

但是,您应该测试ActiveMQ的方法为好,如果10,000消息是一个真正的问题或没有。

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

这篇关于从DB消息允许骆驼重播机制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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