Hi

Make sure that the route is added before you send messages into camel.


On Fri, Apr 12, 2019 at 12:20 PM Vladimir Cherepnalkovski <
cherepnalkov...@hotmail.com> wrote:

> As you can see in the code below, I am using
> producerTemplate.requestBody("direct:createFolderQueue", item);  and
>  from("direct:createFolderQueue").
> It says there is no consumer for "direct"createFolderQueue"
>
> ________________________________
> From: Claus Ibsen <claus.ib...@gmail.com>
> Sent: Friday, April 12, 2019 12:16 PM
> To: users@camel.apache.org
> Subject: Re: ProducerTemaplate with direct or vm component, no consumer
> error
>
> Hi
>
> The ref component refers to an endpoint in the bean registry, eg if you
> setup a bean of endpoint type etc,
> so what you should do is just to use "direct:xxx" instead.
>
> On Fri, Apr 12, 2019 at 11:44 AM Vladimir Cherepnalkovski <
> cherepnalkov...@hotmail.com> wrote:
>
> > Hi all,
> > I got org.apache.camel.NoSuchEndpointException: No endpoint could be
> found
> > for: ref:direct:createFolderQueue .
> >
> > I am using this bean to create one camel context, and use this context in
> > all routes:
> >
> > @Component
> > public class ArkCaseCamelContext
> > {
> >     private CamelContext context;
> >
> >     public ArkCaseCamelContext() throws Exception
> >     {
> >         context = new DefaultCamelContext();
> >         context.start();
> >     }
> >
> > I have producer class :
> >
> > @Component
> > public class CMISQueue
> > {
> >     private ProducerTemplate producerTemplate;
> >
> >     @Autowired
> >     private ArkCaseCamelContext arkCaseCamelContext;
> >
> >     public void createFolder(Item item) throws Exception
> >     {
> >         CamelContext context = arkCaseCamelContext.getContext();
> >         producerTemplate = context.createProducerTemplate();
> >         producerTemplate.start();
> >
> >         producerTemplate.requestBody("direct:createFolderQueue", item);
> >     }
> >
> > and consumer route
> >
> > @Component
> > public class CMISRoute
> > {
> >     private CamelContext camelContext;
> >
> >     @Autowired
> >     private ArkCaseCamelContext arkCaseCamelContext;
> >
> >     public void test() throws Exception
> >     {
> >         camelContext = arkCaseCamelContext.getContext();
> >         camelContext.addRoutes(new RouteBuilder()
> >         {
> >             @Override
> >             public void configure() throws Exception
> >             {
> >                 from("direct:createFolderQueue")
> >                         .startupOrder(1)
> >
> > .log("***********************************************Executing
> > CMISRoute***********************************************")
> >                         .process(exchange -> {
> >
> > exchange.getIn().getHeaders().put(PropertyIds.OBJECT_TYPE_ID,
> > "cmis:folder");
> >
> > exchange.getIn().getHeaders().put(PropertyIds.NAME, "New folder from
> Camel
> > - adfasdfasdf");
> >
> > exchange.getIn().getHeaders().put(CamelCMISConstants.CMIS_FOLDER_PATH,
> > "/User Homes/ann-acm");
> >                         })
> >                         // arkcase-cmis is the file under META-INF which
> > points to ArkCaseCMISComponent
> >                         .to(
> >                                 "arkcase-cmis:......");
> >             }
> >         });
> >     }
> >
> > So, I have direct producer and consumer. Why camel says that there is no
> > consumer for direct:createFolderQueue ?
> > I was trying with direct, seda, vm...
> > I need synchronous communication, because of that I am using direct.
> > Any suggestions are welcomed 🙂
> >
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to