[
https://issues.apache.org/jira/browse/CAMEL-19243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17708371#comment-17708371
]
Raymond edited comment on CAMEL-19243 at 4/4/23 12:59 PM:
----------------------------------------------------------
I did setup using everything needed for Kamelets which means adding:
- Core Camel dependencies
- Kamelet component dependency
- Other related component dependencies (as specified in the Kamelet)
- Kamelet dependencies (util/catalog/main)
I can even load the kamelets, but it didn't work like I expected. Only when
applying my workaround it worked as intended. I do think that using the whole
Kamelet catalog (210 kamelets at the moment) is a powerful extension also in
normal routes. Based on the Kamelet notification it's easy to print missing
dependencies when the user forgets to set something on the classpath.
In a normal route, I would expect that the kamelets are chained like normal
steps and that the "kamelet:sink" endpoint is ignored/disabled.
I can program around (as with the quick workaround), but I think people aspect
such thinks are running out the box (without modifying kamelets) or that it
works on the framework level (not on the runtime or tool level).
was (Author: skin27):
I did setup using everything needed for Kamelets which means adding:
- Core Camel dependencies
- Kamelet component dependency
- Other related component dependencies (as specified in the Kamelet)
- Kamelet dependencies (util/catalog/main)
I can even load the kamelets, but it didn't work like I expected. Only when
applying my workaround it worked as intended. I do think that using the whole
Kamelet catalog (210 kamelets at the moment) is a powerful extension also in
normal routes. Based on the Kamelet notification it's easy to print missing
dependencies when the user forgets to set something on the classpath.
In a normal route, I would expect that the kamelets are chained like normal
steps and that the "kamelet:sink" endpoint is ignored/disabled.
> KameletConsumerNotAvailableException
> ------------------------------------
>
> Key: CAMEL-19243
> URL: https://issues.apache.org/jira/browse/CAMEL-19243
> Project: Camel
> Issue Type: Bug
> Components: camel-kamelet
> Affects Versions: 3.20.3
> Reporter: Raymond
> Priority: Minor
>
> I would like to use the Kamelets from the Kamelet catalog:
> [https://camel.apache.org/camel-kamelets/3.20.x/index.html]
> I have added the Kamelets maven dependency to my project
> [https://mvnrepository.com/artifact/org.apache.camel.kamelets/camel-kamelets]
> And then use it within a route using the Kamelet component:
> {code:java}
> <route id="example">
> <from uri="kamelet:timer-source?message=hello&period=10000"/>
> <to uri="log:foo"/>
> </route> {code}
>
> This gives the following error:
> {code:java}
> 2023-04-03 15:50:03.073 ERROR 40304 --- [ - timer://tick]
> o.a.c.p.e.DefaultErrorHandler : Failed delivery for (MessageId:
> 7E14905736F56C0-000000000000001C on ExchangeId:
> 7E14905736F56C0-000000000000001C). Exhausted after delivery attempt: 1
> caught:
> org.apache.camel.component.kamelet.KameletConsumerNotAvailableException: No
> consumers available on endpoint: kamelet://sink?routeId=timer-source-1.
> Exchange[7E14905736F56C0-000000000000001C]Message History
> ---------------------------------------------------------------------------------------------------------------------------------------
> Source ID
> Processor Elapsed (ms)
> timer-source.kamelet.yaml:64 timer-source-1/timer-source-1
> from[timer://tick?period=10000] 481757935
> timer-source.kamelet.yaml:70 timer-source-1/setBody6
> setBody[constant{{{message}}}] 1
> timer-source.kamelet.yaml:72 timer-source-1/setHeader6
> setHeader[Content-Type] 0
> timer-source.kamelet.yaml:75 timer-source-1/to15
> kamelet://sink?routeId=timer-source-8 0Stacktrace
> ---------------------------------------------------------------------------------------------------------------------------------------org.apache.camel.component.kamelet.KameletConsumerNotAvailableException:
> No consumers available on endpoint: kamelet://sink?routeId=timer-source-1.
> Exchange[7E14905736F56C0-000000000000001C]
> at
> org.apache.camel.component.kamelet.KameletProducer.process(KameletProducer.java:78)
> at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
> at
> org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477)
> at
> org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181)
> at
> org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:165)
> at
> org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:392)
> at
> org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:210)
> at
> org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
> at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
> at java.base/java.util.TimerThread.run(Timer.java:506)2023-04-03
> 15:50:03.074 WARN 40304 --- [ - timer://tick]
> o.a.camel.component.timer.TimerConsumer : Error processing exchange.
> Exchange[7E14905736F56C0-000000000000001C]. Caused by:
> [org.apache.camel.component.kamelet.KameletConsumerNotAvailableException - No
> consumers available on endpoint: kamelet://sink?routeId=timer-source-1.
> Exchange[7E14905736F56C0-000000000000001C]]
> {code}
> Looking at the source of the timer-source Kamelet this is logical:
> [https://github.com/apache/camel-kamelets/blob/main/kamelets/timer-source.kamelet.yaml]
> It has a line:
> to: kamelet:sink
> I'm not sure what this "kamelet:sink" does (all kamels from the catalog have
> it)? When I remove it or change it with another uri (like direct:x) and load
> the yaml from a custom location then the kamelet works.
> Is this a bug? Is this as intended?
> In other words, how can I use the kamelets from the catalog within my routes?
> And is there a way to remove or overwrite the kamelet:sink?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)