Thanks Karsten, I will walk through that stuff and hopefully I get things up and running with that. As I come from the good old Servicemix days, I was wondering as I do not have to configure any kind of connection factory in the blueprint world (I mainly use blueprint routes, rarely in Java). I just use the entpoint as "activemq://queuename" and things work.
Nevertheless, I will work through the stuff you provided. Thanks alot, Heri ________________________________ Von: Karsten Blume <[email protected]> Gesendet: Freitag, 6. Mai 2022 08:22 An: [email protected] <[email protected]> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint Hello Heribert, You need to configure the server AND the client (camel). It is not sufficient to configure the server only. Here: apache-karaf-4.4.0\examples\karaf-jms-example\karaf-jms-example-command\src\main\java\org\apache\karaf\examples\jms\command\SendCommand.java Is an example on how to use a AMQ connection factory by hand. The connection factory is created by some karaf magic/features and cfg files: apache-karaf-4.4.0\examples\karaf-jms-example\karaf-jms-example-features\src\main\feature\feature.xml This creates you the conn factory, you could use/reference it in your camel context. camel-examples\examples\jms-file\src\main\java\org\apache\camel\example\jmstofile\CamelJmsToFileExample.java Shows how to connect to a JMS server, first by initializing the Camel Jms-Component, then the usage in the route. In blueprint it could be a reference to the connection factory (which was created by the feature.xml and cfg file) and with that an initialization of the JMS component bean in your blueprint. Then your route is using the component (with whatever name you choose). Bye Karsten Von: Steuer Heribert <[email protected]> Gesendet: Donnerstag, 5. Mai 2022 15:13 An: [email protected] Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint Hello Karsten, thanks for you reply. The default rollout already provides the file ${KARAF_BASE}/etc/org.apache.activemq.server-default.cfg which is also mentioned in the documentation at https://activemq.apache.org/osgi-integration.html<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Factivemq.apache.org%2Fosgi-integration.html&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=v5EY1%2BcVxWkAfTcrJPJtBUhTG5JRi6rVcoz0rcewnto%3D&reserved=0>. Also, the activemq.xml file is present in the etc directory and looks okay for me (compared to the one in Servicemix). Both files are default and I did not touch them. Walking through e.g. http://liquid-reality.de/Karaf-Tutorial/05/<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fliquid-reality.de%2FKaraf-Tutorial%2F05%2F&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=LxXWQ3C1U3SKB9pFADsuzhNb3PSDXTB1UjiKG%2BiWto0%3D&reserved=0> leads to the same issue. Would be great if you could point me to the right direction ... Cheers, Heri ________________________________ Von: Karsten Blume <[email protected]<mailto:[email protected]>> Gesendet: Donnerstag, 5. Mai 2022 12:18 An: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint Hello Heribert, You need to use the endpoint or the component parameters to define the broker (URL, user, pwd,…). You could configure the AMQ component as bean including the above parameters, then all “activemq” endpoints in your context use this. Or you define all the parameters in the endpoint URL. The camel and karaf examples for AMQ should give a direction. BR Karsten Von: Steuer Heribert <[email protected]<mailto:[email protected]>> Gesendet: Donnerstag, 5. Mai 2022 11:41 An: [email protected]<mailto:[email protected]> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint Hello Erne, thanks for your answer. I tried that already which leads to the same exception (see below), just the endpoint looks a little bit different now. 11:38:38.860 ERROR [Blueprint Event Dispatcher: 1] Error occurred during starting CamelContext: camel-6 org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq:queue:in] -> [Log[PROCESSED MESSAG... because of Failed to resolve endpoint: activemq://queue:in due to: java.lang.IllegalArgumentException: wrong number of arguments Any other ideas? Cheers, Heri ________________________________ Von: Tasi, Erne <[email protected]<mailto:[email protected]>> Gesendet: Donnerstag, 5. Mai 2022 11:09 An: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint Sorry, the correct URL to the Documentation would be ActiveMQ :: Apache Camel<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcamel.apache.org%2Fcomponents%2F3.16.x%2Factivemq-component.html&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1oHOvOFEut185UTWKrnGBL0rZ9Rejogdo9fj4wbxOvY%3D&reserved=0>. At first I could not send the previous mail and afterwards something went wrong as I copy-pasted my original answer. Cheers, Erne Von: Tasi, Erne Gesendet: Donnerstag, 5. Mai 2022 10:42 An: [email protected]<mailto:[email protected]> Betreff: AW: Problems setting up Karaf with ActiveMQ and Blueprint Hi Heri, As the Exception states you did not provide all the needed arguments in you= from and to statements. According to the documentation ActiveMQ :: Apache Camel<https://camel.apach= e.org/components/3.16.x/activemq-component.html<https://camel.apach=%20e.org/components/3.16.x/activemq-component.html>> your Route would have to look something like this: <route id="test"> <from uri="activemq:queue:in"/> <log message="Message: ${body}"/> <to uri="activemq:queue:out"/> </route> Best Regards, Erne Von: Steuer Heribert [mailto:[email protected]] Gesendet: Donnerstag, 5. Mai 2022 09:57 An: [email protected]<mailto:[email protected]> Betreff: Problems setting up Karaf with ActiveMQ and Blueprint Hello, we are currently trying to upgrade a couple of old Apache Servicemix installations which came pre-bundled with Karaf, ActiveMQ, Camel and Blueprint support. As it seems that Servicemix is no longer maintained, I would like to set up a similar instance with Karaf and the appropriate bundles. Setup: Karaf 4.3.7 running on openjdk version "17.0.1" 2021-10-19 On a freshly unpacked Karaf instance, I execute the following commands: feature:repo-add activemq 5.16.4 feature:repo-add camel 3.16.0 feature:repo-refresh feature:install activemq-broker feature:install camel-jms feature:install camel-blueprint Running a simple blueprint route (route attached below) that reads from a queue and writes to another queue fails with: 2022-05-05T09:41:46,026 | ERROR | Blueprint Event Dispatcher: 1 | BlueprintCamelContext | 213 - org.apache.camel.karaf.camel-blueprint - 3.16.0 | Error occurred during starting CamelContext: camel-1 org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments I found some issues on the web related to that exception but all points refer to packages that I do not use (activemq-camel). I have attached the full stack trace below for completeness. I am pretty sure that this just happens because of lack of knowledge, but I did not find a path out of that problem. So hopefully one of you can point me to the right direction. Cheers, Heri org.apache.camel.FailedToCreateRouteException: Failed to create route test: Route(test)[From[activemq://in] -> [Log[PROCESSED MESSAGE],... because of Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:80) ~[!/:3.16.0] at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[!/:3.16.0] at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:887) ~[!/:3.16.0] at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:775) ~[!/:3.16.0] at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2937) ~[!/:3.16.0] at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[!/:3.16.0] at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2620) ~[!/:3.16.0] at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[!/:3.16.0] at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2639) ~[!/:3.16.0] at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:255) ~[!/:3.16.0] at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[!/:3.16.0] at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[!/:3.16.0] at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) [!/:3.16.0] at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) [!/:1.10.3] at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) [!/:1.10.3] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?] at java.lang.Thread.run(Thread.java:833) [?:?] Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: activemq://in due to: java.lang.IllegalArgumentException: wrong number of arguments at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:982) ~[!/:3.16.0] at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0] at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0] at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0] at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0] at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0] ... 23 more Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: wrong number of arguments at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:41) ~[!/:3.16.0] at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?] at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?] at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0] at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0] at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0] at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0] at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0] at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0] at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0] ... 23 more Caused by: java.lang.IllegalArgumentException: wrong number of arguments at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at org.apache.camel.util.IntrospectionSupport.extractProperties(IntrospectionSupport.java:39) ~[!/:3.16.0] at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?] at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1118) ~[?:?] at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[!/:3.16.0] at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:948) ~[!/:3.16.0] at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:864) ~[!/:3.16.0] at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58) ~[!/:3.16.0] at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:191) ~[!/:3.16.0] at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94) ~[!/:3.16.0] at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74) ~[!/:3.16.0] ... 23 more Sample route: <?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osgi.org%2Fxmlns%2Fblueprint%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=K4wEZQkd2ifG3KeJ8jU%2FgqKD6n6ZAxz6z4bh7%2FylarY%3D&reserved=0>" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Faries.apache.org%2Fblueprint%2Fxmlns%2Fblueprint-cm%2Fv1.0.0&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jYw15fNNfgvCK5Hii46xVXjQ9LQ7%2FZFoCrtrrwc8SKo%3D&reserved=0>"> <camelContext xmlns="http://camel.apache.org/schema/blueprint<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcamel.apache.org%2Fschema%2Fblueprint&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=wjPHTP6QPL%2B3tgU5T8CL5mdljvwSx9JhOUHrdNVqitI%3D&reserved=0>"> <route id="test"> <from uri="activemq://in"/> <log message="PROCESSED MESSAGE"/> <to uri="activemq://out"/> </route> </camelContext> </blueprint> CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cenit.com%2F&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uwJpPTs51Z2DEWetUj1T8Ry9MuI7j73KktnDsABD5E8%3D&reserved=0> Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta Bankverbindungen (Bank Accounts): Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS, Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600, Registergericht (Registry court): Amtsgericht Stuttgart Handelsregister (Commercial Register): HRB Nr. 19117 Umsatzsteuer (VAT) ID: DE 147 862 777 CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.com<https://apc01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cenit.com%2F&data=05%7C01%7Ckarsten.blume%40ottoint.com%7C3d59251800e743fd0cf108da2e990a03%7Cf73d6f0048944b4eba0071d6df45717d%7C0%7C0%7C637873532854609662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uwJpPTs51Z2DEWetUj1T8Ry9MuI7j73KktnDsABD5E8%3D&reserved=0> Geschaeftsstellen (Branch Offices): Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken Vorstandsmitglieder (Members of the Board): Peter Schneck, Dr. Markus Wesel Aufsichtsratsmitglieder (Supervisory Board Members): Rainer Koppitz (Vorsitzender des Aufsichtsrats / Chairman of the Supervisory Board), Prof. Dr. Isabell Welpe, Ricardo Malta Bankverbindungen (Bank Accounts): Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS, Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600, Registergericht (Registry court): Amtsgericht Stuttgart Handelsregister (Commercial Register): HRB Nr. 19117 Umsatzsteuer (VAT) ID: DE 147 862 777
