【问题标题】:Spring cloud stream artemis binder concurrency not workingSpring Cloud Stream Artemis Binder 并发不起作用
【发布时间】:2021-12-13 14:45:48
【问题描述】:

我已经使用 Artemis binder https://github.com/snowdrop/spring-cloud-stream-binder-artemis 设置了 spring cloud stream。我有两个应用程序,即生产者和消费者。下面是我的 application.yml 配置

生产者配置

spring:
  main:
    allow-bean-definition-overriding: true
  cloud:
    stream:
      poller:
        fixed-delay: 5000
      bindings:
        sourceForBroker-out-0:
          destination: exchange
      function:
        definition: sourceForBroker

消费者配置

spring:
  main:
    allow-bean-definition-overriding: true
  cloud:
    stream:
      bindings:
        r1:
          destination: exchange
          group: group1
          consumer:
            max-attempts: 1
            concurrency: 10
      function:
        bindings:
          r1Consumer-in-0: r1
        definition: r1Consumer

一切正常,即生产者将数据发送到队列,消费者能够处理数据,但不会反映并发性。当我检查 Artemis 控制台时,我看到只有一个消费者。附上控制台截图

【问题讨论】:

  • 这个活页夹由社区单独维护。最好在 GH 上与他们联系并在那里提出问题。

标签: java spring spring-cloud-stream activemq-artemis


【解决方案1】:

一个生产者可以有多个消费者。您的消费者是唯一的,这就是为什么它只显示一个线程。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-12-16
  • 2019-04-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多