Camel route不入门 Spring Boot 应用程序中的问题

rbl8hiat  于 2022-11-07  发布在  Apache
关注(0)|答案(1)|浏览(133)

1.我使用的是 Spring Boot 应用程序。
1.我有一个camel组件,它配置如下:

@Configuration
class FrameworkPipelineInboundSQSRoute
    @Autowired
    private SalesOrderGetHelper salesOrderGetHelper;
    @Bean(name = "frameworkPipelineInboundSQSRouteBuilder")
    public RouteBuilder route() {
        String inboundSqsUri = SQSUtil.buildSqsUri(
            financialOrderInboundSqsName, maxConsumerThreads, maxMessageBatchSize, 
            deleteIfFiltered, messageAttributeNames, defaultVisibilityTimeout
        );
        log.info("framework pipeline Inbound SQS Uri={}", inboundSqsUri);
        return new RouteBuilder() {
            @Override
            public void configure() {
                errorHandler(
                  ...
                    from("direct:xx") route code goes here..

当我使用bootRun命令启动应用程序时,我得到如下消息:

INFO 2022-03-09 15:17:44,842 [main] traceID= app=frameworkpipeline ver=unspecified.0 cl=org.springframework.context.support.PostProcessorRegistrationDelegate$BeanP
ostProcessorChecker : Bean org.apache.camel.spring.boot.CamelAutoConfiguration of type org.apache.camel.spring.boot.CamelAutoConfiguration is not eligible for 
getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

and sometimes, camel route not started like here:
INFO 2022-03-09 06:48:49,852 [main] traceID= app=frameworkpipeline ver=unspecified.12 cl=org.apache.camel.impl.engine.AbstractCamelContext : Total 0 routes, of which 0 are started

我看到线程说添加@Lazy而不是@Autowired,我也尝试了。遇到了同样的问题。您能告诉如何解决这个问题吗?因为没有启动camel路由,所以SQS消息不会被使用。

izj3ouym

izj3ouym1#

您的应用程序中是否有引用frameworkPipelineInboundSQSRouteBuilder的内容?如果没有,则没有任何理由创建它。

相关问题