简体   繁体   English

不允许同一端点的多个消费者

[英]Multiple consumers for the same endpoint is not allowed

I would like to read files from a directory with camel file consumer but I need my route to be transacted.我想从带有骆驼文件使用者的目录中读取文件,但我需要处理我的路线。 So I can not use threads inside the rout.所以我不能在溃败中使用线程。 Is it ok to write multiply routes to read from the same endpoint (same directory) with a little change between the uris (for example the sort type) , and like this to avoid the Multiple consumers for the same endpoint is not allowed exception ?是否可以编写多个路由以从同一个端点(同一个目录)读取,在 uris 之间进行一些更改(例如排序类型),并且像这样避免同一端点的多个消费者是不允许的例外?

Yeah sure you can do that, mind that you will have competing consumes for the same files now, so mind about read-locks.是的,您肯定可以做到这一点,请注意您现在将对相同的文件进行竞争性消费,因此请注意读锁。 By default Camel use the marker file.默认情况下,Camel 使用标记文件。

You can also use different delay so they dont poll at the same interval/time.您还可以使用不同的延迟,以便它们不会以相同的间隔/时间进行轮询。 And you can sort by random to make less chance of processing the same files.您可以随机排序以减少处理相同文件的机会。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM