简体   繁体   English

Camel JMS 组件多线程

[英]Camel JMS Component multithreading

I have a spring boot app consuming messages from multiple Solace queues using Camel's jmsComponent .我有一个 spring 启动应用程序使用 Camel 的jmsComponent消耗来自多个 Solace 队列的消息。 I have defined a Camel route for each queue connection and a Camel Processor for converting messages into json .我为每个队列连接定义了一个Camel route和一个Camel Processor ,用于将消息转换为json There is a high volume of messages coming from the queues and my program is not able to keep up with the speed.队列中有大量消息,我的程序跟不上速度。

Route:路线:

@Component
public class SomeRoute extends RouteBuilder {
    @Override
    public void configure() throws Exception {
        from("jms:{{queue.name}}").process("xmlToJsonProcessor")
            .to("kafka:{{topic}}?brokers={{spring.kafka.bootstrap-servers}}&securityProtocol={{spring.kafka.properties.security.protocol}}&saslMechanism={{spring.kafka.properties.sasl.mechanism}}&saslJaasConfig={{spring.kafka.properties.sasl.jaas.config}}");
    }   
}

I've been looking up how to split each route into its own thread but no luck so far.我一直在寻找如何将每条路线分成自己的线程,但到目前为止还没有运气。 Any ideas?有任何想法吗?

Why don't you increase the number of consumers for each queue?为什么不增加每个队列的消费者数量?

    @Override
    public void configure() throws Exception {
        from("jms:{{queue.name}}?concurrentConsumers=10")
            .process("xmlToJsonProcessor")
            .to(".....");
    }   
   

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

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