Why don't you use

public class MyRouteBuilder extend RouteBuilder {

@Override

public void configure() {

from("...")

   .to("...");

}

}

You are able to use Autowired fields in inherited class.

On 3/9/22 16:54, Prabhu, Justin (ETW - Wipro) wrote:
Hi Team,


   1.  Iam using a springboot application.

I have camel component which is configured as follows:
@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..


   1.  When i Start application using bootRun command, I get message such as:
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, 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

I saw thread which said to add @Lazy instead of @Autowired.tried that as well. 
Got same issue.


   1.  I have other routes which don't have @autowired at all. Even these 
routes are not recognized by camel context.
   2.  However, I got message camel context is starting.( INFO 2022-03-09 
19:07:18,126 [main] traceID= app=frameworkpipeline ver=unspecified.0 
cl=org.apache.camel.impl.engine.AbstractCamelContext : Apache Camel 3.1.0 (Cam
elContext: camel-1) is starting)

Can you tell how to resolve this issue as SQS messages are not consumed as no 
camel route has started.
Early response will be helpful and appreciated as it is bit urgent for my 
project.

Thanks and Regards,
Justin.


--
Vyacheslav Boyko
mailto:mail4...@gmail.com

Reply via email to