【问题标题】:Apache Camel - SedaEndpointApache Camel - SedaEndpoint
【发布时间】:2017-05-19 14:56:43
【问题描述】:

我正在尝试向异步路由发送消息,但它不起作用。 我刚刚在github上创建了一个projeto来模拟这个问题

@SpringBootApplication
public class SedaQueueApplication implements CommandLineRunner {

@Autowired
@EndpointInject(uri = "direct://direct-queue")
ProducerTemplate producerTemplate;

public static void main(String[] args) {
    SpringApplication.run(SedaQueueApplication.class, args);
}

@Override
public void run(String... strings) throws Exception {
    producerTemplate.sendBody("Teste Direct - Async");
}

@Component
class Router extends RouteBuilder {

    @Override
    public void configure() throws Exception {
        from("direct://direct-queue").routeId("toAsync").to("seda://async-queue?size=100");

        from("seda://async-queue").routeId("toLog").log("${body}");
    }
}

【问题讨论】:

  • 首先,不要放其他项目的链接。很少有人会查看这些链接。而是将实际问题放在相关代码和异常/堆栈跟踪上。
  • 抱歉,我会编辑问题

标签: spring-boot apache-camel


【解决方案1】:
  1. 您有两条路线。在您指定seda://async-queue 和其他seda://async-queue?size=100 的其中一条路线中保持一致,即为第一条路线添加大小属性或从第二条路线中删除。它会像桃子一样工作。
  2. 原因是(不确定这是否是骆驼代码中的错误),在SedaComponent::getOrCreateQueue 他们也在比较大小属性。因此,如果 size 属性存在且不匹配,则会出现异常。

希望对您有所帮助。

【讨论】:

    猜你喜欢
    • 2018-06-15
    • 2015-05-29
    • 2012-12-21
    • 1970-01-01
    • 2010-12-30
    • 2016-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多