You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by "John F. Berry" <bo...@yahoo.com> on 2018/10/16 18:54:01 UTC

Running Camel in a Karaf OSGi container

 New user to Karaf due to the fact that my development work in Apache Camel is wanted by people to be installed on a Windows server and to be installed as a service.  This led me to the Karaf product.I've asked the Camel users forum about migration steps, but now I think this is more of a Karaf and/or maven deployment thing than a Camel issue.
I have developed a route in Camel using maven and hand writing a Java DSL route (no Eclipse or other tool).  I can run the jar as a standalone execution fine from a command line.
I did create a OSGi service wrapper in karaf and did have a window service instance installed.
I just cannot seem to get Karaf to "deploy" it (a.k.a. pick up and run with it under that OSGi container that is running.
Sorry for the generalities, new to the open source community and the idea that you need to be fully immersed in every Apache offering (Camel, Maven, Felix, ServiceMix, Karaf,  etc.) to utilize any one of them  :P    I have felix and blueprint dependencies in my POM.. but they been through many different forms in an attempt to run it.  It is a Java DSL Camel archetype that has been built, but cannot seem to generate supporting files for Karaf to recognize my little creation.
Ideas?  Later I attempted to make an "empty" project with maven selecting "org.apache.camel.archetypes:camel-archetype-blueprint", but I cannot even get that base package to run (the small Hello World code) without java blowing up.  The one I built, compiled, ran, tested and "jar"ed was from the "org.apache.camel.archetypes:camel-archetype-java" maven archetype skeleton.  I attempted to merge the two.. but no luck so far!
Thanks!

Re: Running Camel in a Karaf OSGi container

Posted by Francois Papon <fr...@openobject.fr>.
Hi,

Generaly you have to package your bundle with a pom.xml like this :

<packaging>bundle</packaging>

    <dependencies>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
            <version>2.22.1</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>3.5.1</version>
                <extensions>true</extensions>
                <inherited>true</inherited>
                <configuration>
                    <instructions>
                        <Export-Package></Export-Package>
                        <Import-Package>*</Import-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

and put your camel-context.xml into the
src/main/resources/OSGI-INF/blueprint/

regards,

François Papon
fpapon@apache.org

Le 16/10/2018 à 23:45, John F. Berry a écrit :
> Thanks Francois for the info.  Now I will show my shallow knowledge of Karaf (or this Apache family for that matter).. 
> What is the "bundle" that you drop in the deploy folder.. is it the entire project with all its directories?  
> I haven't successfully made this a blueprint camel project yet.. I make a blank one and cannot get it to install without an error (before I modify it):
>
> [         Blueprint Extender: 1] BlueprintContainerImpl         INFO  Blueprint bundle org.apache.aries.blueprint.core/1.10.0 has been started
> [         Blueprint Extender: 2] BlueprintContainerImpl         ERROR Unable to start container for blueprint bundle org.apache.camel.camel-blueprint/2.22.1
> org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to instantiate components
>
> ________________________________
>
> From: Francois Papon <fr...@openobject.fr>
> To: user@karaf.apache.org 
> Sent: Tuesday, October 16, 2018 3:18 PM
> Subject: Re: Running Camel in a Karaf OSGi container
>
>
>
> Hi John,
> Have you install the camel feature in Karaf ?
> In a Karaf shell : 
>
> karaf@root()> feature:repo-add camel
> karaf@root()> feature:install camel
> If your are using blueprint with Karaf 4.2.x :
> karaf@root()> feature:install aries-blueprint
>
> Then just drop your bundle into the "deploy" folder.
>
> It would be nice if you can share your creation ;)
> regards,
>
> François Papon fpapon@apache.org
> Le 16/10/2018 à 22:54, John F. Berry a écrit :
>
> New user to Karaf due to the fact that my development work in Apache Camel is wanted by people to be installed on a Windows server and to be installed as a service.  This led me to the Karaf product.
> I've asked the Camel users forum about migration steps, but now I think this is more of a Karaf and/or maven deployment thing than a Camel issue.
> I have developed a route in Camel using maven and hand writing
>       a Java DSL route (no Eclipse or other tool).  I can run the
>       jar as a standalone execution fine from a command line.
> I did create a OSGi service wrapper in karaf and did have a
>       window service instance installed.
> I just cannot seem to get Karaf to "deploy" it (a.k.a. pick up
>       and run with it under that OSGi container that is running.
> Sorry for the generalities, new to the open source community
>       and the idea that you need to be fully immersed in every
>       Apache offering (Camel, Maven, Felix, ServiceMix, Karaf, 
>       etc.) to utilize any one of them  :P    I have felix and
>       blueprint dependencies in my POM.. but they been through many
>       different forms in an attempt to run it.  It is a Java DSL
>       Camel archetype that has been built, but cannot seem to
>       generate supporting files for Karaf to recognize my little
>       creation.
> Ideas?  
> Later I attempted to make an "empty" project with maven selecting "org.apache.camel.archetypes:camel-archetype-blueprint", but I cannot even get that base package to run (the small Hello World code) without java blowing up.  The one I built, compiled, ran, tested and "jar"ed was from the "org.apache.camel.archetypes:camel-archetype-java" maven archetype skeleton.  I attempted to merge the two.. but no luck so far!
>
> Thanks!


Re: Running Camel in a Karaf OSGi container

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

afaik you can also use declarative Services as starting point for your
Camel routes/rotue-builders

http://camel.apache.org/camel-and-scr.html

Therefore I'd think blueprint isn't mandatory.
Also it's not mandatory to start with a blueprint dsl, use java instead
just let your route builder be created by blueprint.

As usual, there are many roads to Rome.

Regards, Achim

Am Do., 18. Okt. 2018 um 10:17 Uhr schrieb Tim Ward <ti...@paremus.com>:

> This is an argument that I hear a lot. I’m not a Camel expert, but it
> really sounds as though the DSL needs some work. The whole point of a DSL
> is that by being domain specific it is supposed to be natural and easy.
> Instead it sounds as though it is forcing people into using Blueprint
> despite that being a “less preferred” option for some people.
>
> Given the level of Camel integration in Karaf/Blueprint there must be
> someone in the community with the relevant skills to overhaul the DSL and
> make it fit for purpose?
>
> Best Regards,
>
> Tim
>
> On 17 Oct 2018, at 23:46, John F. Berry <bo...@yahoo.com> wrote:
>
> Thank you.. I was thinking of abandoning the Java DSL and ultimately going
> this way, given my lack of success of "dumping it" into an OSGi container
> of some sort.  The rest of my shop, though, are not blueprint DSL, Camel or
> Apache product savvy, so the learning curve for my coworkers will be more
> disconnected than tapping into their java knowledge.
> I was attempting, originally, to introduce Camel as a solution via Java
> DSL to encourage its adoption.
>
> On Wednesday, October 17, 2018, 3:50:58 PM EDT, Jean-Baptiste Onofré <
> jb@nanthrax.net> wrote:
>
>
> You can also directly use the Camel Blueprint DSL directly, just putting
> your route in OSGI-INF/blueprint/route.xml:
>
> <blueprint>
>     <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>         <route id="foo">
>             <from uri="..."/>
>             ...
>             <to uri="..."/>
>         </route>
>     </camelContext>
> </blueprint>
>
> Regards
> JB
>
> On 17/10/2018 21:46, Ranx wrote:
> >
> > You'll want to use the bundle plugin and create a blueprint.xml to
> bootstrap
> > your Camel Java DSL. I use the Camel Java DSL all the time in Blueprint
> for
> > a variety of reasons (testing is easier as the RouteBuilders exist
> without
> > the camel context). I’m not sure why your Camel blueprint archetype is
> > blowing up but I’d start with that first but then you’ll have to modify
> the
> > blueprint file to add your
> >
> > Here's a snippet:
> >
> >
> > <bean class="foo.bar.MyFirstRouteBuilder" id="firstRouteBuilder"/>
> > <bean class="foo.bar.MySecondRouteBuilder" id="secondRouteBuilder"/>
> >
> >
> >      <camelContext
> > id="document-logic-service"xmlns="
> http://camel.apache.org/schema/blueprint">
> >          <routeBuilder ref="firstRouteBuilder"/>
> >          <routeBuilder ref="secondRouteBuilder"/>
> >      </camelContext>
> >
> > The RouteBuilders can be independently unit tested then with
> > CamelTestSupport outside the Blueprint container.
> >
> > This also allows an injection and setup to take place for your route
> > builders when they are instantiated and then when the Camel context is
> given
> > their reference. Without that step Camel and Felix/Karaf are unaware of
> > their existence.
> >
> > If you can’t get the archetype to run and create a Camel Blueprint
> project
> > for you, I’d Google around for a sample project that has the POM correct.
> >
> > Generally I'll have a features file and configuration file associated
> with
> > the project as well so that the features repository can be added and
> > installed. There may be a better way to do this with profiles in Karaf 4
> but
> > I'm a bit behind the times in that regard.
> >
> > Ranx
> >
> >
> >
> >
> > --
> > Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> >
>
>
>

-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Running Camel in a Karaf OSGi container

Posted by Ranx <ra...@enjekt.org>.
The Camel Java DSL works fine with Blueprint in Karaf. One simply bootstraps
the RouteBuilder in Blueprint and then references in the Camel context of
the Blueprint file. I think the problem is that documentation is inadequate.
And, as Camel, Karaf, etc. changed over time documentation became krufty.

Essentially if one limits the use of Blueprint to configuration, OSGi
services export and reference, and bootstrap of Camel routes it is just
fine.

As soon as one starts using XML as a programming language the problems
begin.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Running Camel in a Karaf OSGi container

Posted by Ranx <ra...@enjekt.org>.
Paul,

I agree. I've used Blueprint for a long time and it is a thorny with Camel.
I've limited my use of Blueprint these days to 1) configuration, 2) service
management, and 3) bootstrap. If one keeps in minimal like that Blueprint is
fine. But I've gone into a lot of different clients where they have reams of
opaque Blueprint XML and Processors/Exchanges and even bright developers are
struggling to understand it. Inevitably unit testing in those cases is
non-existent. There are a three or four primary reasons testing gets
jettisoned in that case. If one switches to using the Camel Java DSL and
Java pojos for handlers, those problems melt away and Blueprint becomes
tractable.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Running Camel in a Karaf OSGi container

Posted by Paul McCulloch <pk...@gmail.com>.
You can successfully use both the XML/BluePrint DSL or the Java DSL from
Karaf. In my experience testing the XML DSL is hard - so I wouldn't use
blueprint. I put together a very simple example of using the Java DSL, in
an OSGi environment at
https://github.com/paul-mcculloch/camel-karaf-noblueprint which shows how
simple it can be - a simple POM & one class.

Having said that, I do question the need for Karaf in your specific
situation. If you just need to run some Camel routes as a Windows service
then using Karaf is something of a sledgehammer to crack quite a small nut.
The Camel docs include an example of a long running application  -
http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html
.

Another alternative that could be a better fit is Spring - that's what I
used before moving to Karaf.

If you want to run that as a service then just use something like
https://wrapper.tanukisoftware.com (which is what Karaf bundles I think) or
http://yajsw.sourceforge.net/ (I've not tried this one).



On Thu, 18 Oct 2018 at 18:43, Ranx <ra...@enjekt.org> wrote:

> Absolutely, do use the Camel Java DSL even when you bootstrap with
> Blueprint.
> Write unit tests using CamelTestSupport and only sparingly use the
> CamelBlueprintTestSupport. Avoid Processors/Exchanges and use plain pojo
> handlers instead. Camel uses reflection on any bean it finds in the path
> and
> will automatically invoke the correct method on your handler based on
> assignment of class type. This means you can use simple JUnit tests on your
> handlers. The Camel in Action book recommends that but they don’t get to it
> until over 100 pages in and then it’s in the form of a set of bullet points
> in the conclusion of the chapter. If you follow those practices it will
> make
> it very easy for Java developers to use OSGi and Blueprint as Blueprint
> will
> only be used for configuration and not for coding.
>
> The issue you’re running into is almost certainly related to not using the
> Maven bundle plugin which generates the Manifest automatically. Essentially
> the plugin reads your code and your Blueprint file and figures out what
> dependencies it needs, what to import and what to export, and writes that
> Manifest for you. The OSGi container reads that Manifest to figure out how
> to bootstrap everything. The route builder references I show below will
> then
> boot it up correctly.
>
> Using the Java DSL means your code and your knowledgebase is domain
> neutral.
> In other words, your code, tests and skills are as applicable to standalone
> applications as to Karaf or Spring Boot or J2EE. Blueprint XML Camel routes
> are specific to Blueprint so just avoid them. Eventually you’ll want to
> look
> at features files for installing all your dependencies at start up
> including
> the configuration files.
>
> If you can get the Camel Blueprint archetype to run, then you should have
> everything you need and just use the route builder reference mechanism I
> showed below and it will work like a champ.
>
> This is one of those places where we really do need an “opinionated”
> SpringBoot style of coding practices. It’s usually pretty easy to justify
> these practices because they result in easily unit tested code that Java
> developers understand. Using Camel Blueprint DSL and XML and
> Processors/Exchanges always, in my experience, leads to code that has zero
> unit tests associated with it.
>
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

Re: Running Camel in a Karaf OSGi container

Posted by Ranx <ra...@enjekt.org>.
Absolutely, do use the Camel Java DSL even when you bootstrap with Blueprint.
Write unit tests using CamelTestSupport and only sparingly use the
CamelBlueprintTestSupport. Avoid Processors/Exchanges and use plain pojo
handlers instead. Camel uses reflection on any bean it finds in the path and
will automatically invoke the correct method on your handler based on
assignment of class type. This means you can use simple JUnit tests on your
handlers. The Camel in Action book recommends that but they don’t get to it
until over 100 pages in and then it’s in the form of a set of bullet points
in the conclusion of the chapter. If you follow those practices it will make
it very easy for Java developers to use OSGi and Blueprint as Blueprint will
only be used for configuration and not for coding.

The issue you’re running into is almost certainly related to not using the
Maven bundle plugin which generates the Manifest automatically. Essentially
the plugin reads your code and your Blueprint file and figures out what
dependencies it needs, what to import and what to export, and writes that
Manifest for you. The OSGi container reads that Manifest to figure out how
to bootstrap everything. The route builder references I show below will then
boot it up correctly.

Using the Java DSL means your code and your knowledgebase is domain neutral.
In other words, your code, tests and skills are as applicable to standalone
applications as to Karaf or Spring Boot or J2EE. Blueprint XML Camel routes
are specific to Blueprint so just avoid them. Eventually you’ll want to look
at features files for installing all your dependencies at start up including
the configuration files. 

If you can get the Camel Blueprint archetype to run, then you should have
everything you need and just use the route builder reference mechanism I
showed below and it will work like a champ. 

This is one of those places where we really do need an “opinionated”
SpringBoot style of coding practices. It’s usually pretty easy to justify
these practices because they result in easily unit tested code that Java
developers understand. Using Camel Blueprint DSL and XML and
Processors/Exchanges always, in my experience, leads to code that has zero
unit tests associated with it.




--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Running Camel in a Karaf OSGi container

Posted by "John F. Berry" <bo...@yahoo.com>.
Thank you Tim for the affirmation, 

Apache Camel, at least, touts that you can tie in so many technologies for just about any connection technology, any payload, and transform to another, all by utilizing the massive collection of work done by others, instead of hand coding it yourself. Feeling like I hit a brick wall when it came to "plugging in" one Apache product to another, I began to question my technological skills; like I must be missing some big concept.  

I don't mean to start a Camel complaint thread, where I whine and carry on.. I am still pushing the idea ahead here... that I'm still at a stoppage of further progress; that I cannot seem to either start again and redevelop under a vanilla Karaf acceptable project.. or port this Java DSL into something that can be called from something that runs under Karaf.

If I am to reference a "bean" within a  Blueprint archetype, and my "bean" is what is instantiating a Camel context.. Can I simply use a non-camel maven blueprint archetype, since the camel-blueprint one is giving me trouble?  I've googled all the responses here and attempted what I thought I could do.. but one slight off topic thread said it might be my java version?  I did start this project with the most current Java to begin, so it would be a bit before it got behind, and used Java 10.  Perhaps that is too new to play nice with others?

It's been a bit on this thread since I included my code, so I will send it again.
Thanks all!


On ‎Thursday‎, ‎October‎ ‎18‎, ‎2018‎ ‎04‎:‎17‎:‎37‎ ‎AM‎ ‎EDT, Tim Ward <ti...@paremus.com> wrote: 





This is an argument that I hear a lot. I’m not a Camel expert, but it really sounds as though the DSL needs some work. The whole point of a DSL is that by being domain specific it is supposed to be natural and easy. Instead it sounds as though it is forcing people into using Blueprint despite that being a “less preferred” option for some people.

Given the level of Camel integration in Karaf/Blueprint there must be someone in the community with the relevant skills to overhaul the DSL and make it fit for purpose?

Best Regards,

Tim

> On 17 Oct 2018, at 23:46, John F. Berry <bo...@yahoo.com> wrote:
> 
> 
> 
> Thank you.. I was thinking of abandoning the Java DSL and ultimately going this way, given my lack of success of "dumping it" into an OSGi container of some sort.  The rest of my shop, though, are not blueprint DSL, Camel or Apache product savvy, so the learning curve for my coworkers will be more disconnected than tapping into their java knowledge.
> I was attempting, originally, to introduce Camel as a solution via Java DSL to encourage its adoption. 
> 
> 
>  
>  
>  On Wednesday, October 17, 2018, 3:50:58 PM EDT, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote: 
> 
> 
> 
> 
> 
> You can also directly use the Camel Blueprint DSL directly, just putting 
> your route in OSGI-INF/blueprint/route.xml:
> 
> <blueprint>
>     <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>         <route id="foo">
>             <from uri="..."/>
>             ...
>             <to uri="..."/>
>         </route>
>     </camelContext>
> </blueprint>
> 
> Regards
> JB
> 
> On 17/10/2018 21:46, Ranx wrote:
>> 
>> You'll want to use the bundle plugin and create a blueprint.xml to bootstrap
>> your Camel Java DSL. I use the Camel Java DSL all the time in Blueprint for
>> a variety of reasons (testing is easier as the RouteBuilders exist without
>> the camel context). I’m not sure why your Camel blueprint archetype is
>> blowing up but I’d start with that first but then you’ll have to modify the
>> blueprint file to add your
>> 
>> Here's a snippet:
>> 
>> 
>> <bean class="foo.bar.MyFirstRouteBuilder" id="firstRouteBuilder"/>
>> <bean class="foo.bar.MySecondRouteBuilder" id="secondRouteBuilder"/>
>> 
>>      
>>      <camelContext
>> id="document-logic-service"xmlns="http://camel.apache.org/schema/blueprint">
>>          <routeBuilder ref="firstRouteBuilder"/>
>>          <routeBuilder ref="secondRouteBuilder"/>
>>      </camelContext>
>> 
>> The RouteBuilders can be independently unit tested then with
>> CamelTestSupport outside the Blueprint container.
>> 
>> This also allows an injection and setup to take place for your route
>> builders when they are instantiated and then when the Camel context is given
>> their reference. Without that step Camel and Felix/Karaf are unaware of
>> their existence.
>> 
>> If you can’t get the archetype to run and create a Camel Blueprint project
>> for you, I’d Google around for a sample project that has the POM correct.
>> 
>> Generally I'll have a features file and configuration file associated with
>> the project as well so that the features repository can be added and
>> installed. There may be a better way to do this with profiles in Karaf 4 but
>> I'm a bit behind the times in that regard.
>> 
>> Ranx
>> 
>> 
>> 
>> 
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>> 
> 
> 


Re: Running Camel in a Karaf OSGi container

Posted by Tim Ward <ti...@paremus.com>.
This is an argument that I hear a lot. I’m not a Camel expert, but it really sounds as though the DSL needs some work. The whole point of a DSL is that by being domain specific it is supposed to be natural and easy. Instead it sounds as though it is forcing people into using Blueprint despite that being a “less preferred” option for some people.

Given the level of Camel integration in Karaf/Blueprint there must be someone in the community with the relevant skills to overhaul the DSL and make it fit for purpose?

Best Regards,

Tim

> On 17 Oct 2018, at 23:46, John F. Berry <bo...@yahoo.com> wrote:
> 
> Thank you.. I was thinking of abandoning the Java DSL and ultimately going this way, given my lack of success of "dumping it" into an OSGi container of some sort.  The rest of my shop, though, are not blueprint DSL, Camel or Apache product savvy, so the learning curve for my coworkers will be more disconnected than tapping into their java knowledge.
> I was attempting, originally, to introduce Camel as a solution via Java DSL to encourage its adoption. 
> 
> On Wednesday, October 17, 2018, 3:50:58 PM EDT, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 
> 
> You can also directly use the Camel Blueprint DSL directly, just putting 
> your route in OSGI-INF/blueprint/route.xml:
> 
> <blueprint>
>     <camelContext xmlns="http://camel.apache.org/schema/blueprint <http://camel.apache.org/schema/blueprint>">
>         <route id="foo">
>             <from uri="..."/>
>             ...
>             <to uri="..."/>
>         </route>
>     </camelContext>
> </blueprint>
> 
> Regards
> JB
> 
> On 17/10/2018 21:46, Ranx wrote:
> > 
> > You'll want to use the bundle plugin and create a blueprint.xml to bootstrap
> > your Camel Java DSL. I use the Camel Java DSL all the time in Blueprint for
> > a variety of reasons (testing is easier as the RouteBuilders exist without
> > the camel context). I’m not sure why your Camel blueprint archetype is
> > blowing up but I’d start with that first but then you’ll have to modify the
> > blueprint file to add your
> > 
> > Here's a snippet:
> > 
> > 
> > <bean class="foo.bar.MyFirstRouteBuilder" id="firstRouteBuilder"/>
> > <bean class="foo.bar.MySecondRouteBuilder" id="secondRouteBuilder"/>
> > 
> >      
> >      <camelContext
> > id="document-logic-service"xmlns="http://camel.apache.org/schema/blueprint <http://camel.apache.org/schema/blueprint>">
> >          <routeBuilder ref="firstRouteBuilder"/>
> >          <routeBuilder ref="secondRouteBuilder"/>
> >      </camelContext>
> > 
> > The RouteBuilders can be independently unit tested then with
> > CamelTestSupport outside the Blueprint container.
> > 
> > This also allows an injection and setup to take place for your route
> > builders when they are instantiated and then when the Camel context is given
> > their reference. Without that step Camel and Felix/Karaf are unaware of
> > their existence.
> > 
> > If you can’t get the archetype to run and create a Camel Blueprint project
> > for you, I’d Google around for a sample project that has the POM correct.
> > 
> > Generally I'll have a features file and configuration file associated with
> > the project as well so that the features repository can be added and
> > installed. There may be a better way to do this with profiles in Karaf 4 but
> > I'm a bit behind the times in that regard.
> > 
> > Ranx
> > 
> > 
> > 
> > 
> > --
> > Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html <http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html>
> > 


Re: Running Camel in a Karaf OSGi container

Posted by "John F. Berry" <bo...@yahoo.com>.
 Thank you.. I was thinking of abandoning the Java DSL and ultimately going this way, given my lack of success of "dumping it" into an OSGi container of some sort.  The rest of my shop, though, are not blueprint DSL, Camel or Apache product savvy, so the learning curve for my coworkers will be more disconnected than tapping into their java knowledge.I was attempting, originally, to introduce Camel as a solution via Java DSL to encourage its adoption. 

    On Wednesday, October 17, 2018, 3:50:58 PM EDT, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:  
 
 You can also directly use the Camel Blueprint DSL directly, just putting 
your route in OSGI-INF/blueprint/route.xml:

<blueprint>
    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
        <route id="foo">
            <from uri="..."/>
            ...
            <to uri="..."/>
        </route>
    </camelContext>
</blueprint>

Regards
JB

On 17/10/2018 21:46, Ranx wrote:
> 
> You'll want to use the bundle plugin and create a blueprint.xml to bootstrap
> your Camel Java DSL. I use the Camel Java DSL all the time in Blueprint for
> a variety of reasons (testing is easier as the RouteBuilders exist without
> the camel context). I’m not sure why your Camel blueprint archetype is
> blowing up but I’d start with that first but then you’ll have to modify the
> blueprint file to add your
> 
> Here's a snippet:
> 
> 
> <bean class="foo.bar.MyFirstRouteBuilder" id="firstRouteBuilder"/>
> <bean class="foo.bar.MySecondRouteBuilder" id="secondRouteBuilder"/>
> 
>      
>      <camelContext
> id="document-logic-service"xmlns="http://camel.apache.org/schema/blueprint">
>          <routeBuilder ref="firstRouteBuilder"/>
>          <routeBuilder ref="secondRouteBuilder"/>
>      </camelContext>
> 
> The RouteBuilders can be independently unit tested then with
> CamelTestSupport outside the Blueprint container.
> 
> This also allows an injection and setup to take place for your route
> builders when they are instantiated and then when the Camel context is given
> their reference. Without that step Camel and Felix/Karaf are unaware of
> their existence.
> 
> If you can’t get the archetype to run and create a Camel Blueprint project
> for you, I’d Google around for a sample project that has the POM correct.
> 
> Generally I'll have a features file and configuration file associated with
> the project as well so that the features repository can be added and
> installed. There may be a better way to do this with profiles in Karaf 4 but
> I'm a bit behind the times in that regard.
> 
> Ranx
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 
  

Re: Running Camel in a Karaf OSGi container

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
You can also directly use the Camel Blueprint DSL directly, just putting 
your route in OSGI-INF/blueprint/route.xml:

<blueprint>
	<camelContext xmlns="http://camel.apache.org/schema/blueprint">
		<route id="foo">
			<from uri="..."/>
			...
			<to uri="..."/>
		</route>
	</camelContext>
</blueprint>

Regards
JB

On 17/10/2018 21:46, Ranx wrote:
> 
> You'll want to use the bundle plugin and create a blueprint.xml to bootstrap
> your Camel Java DSL. I use the Camel Java DSL all the time in Blueprint for
> a variety of reasons (testing is easier as the RouteBuilders exist without
> the camel context). I’m not sure why your Camel blueprint archetype is
> blowing up but I’d start with that first but then you’ll have to modify the
> blueprint file to add your
> 
> Here's a snippet:
> 
> 
> <bean class="foo.bar.MyFirstRouteBuilder" id="firstRouteBuilder"/>
> <bean class="foo.bar.MySecondRouteBuilder" id="secondRouteBuilder"/>
> 
>      
>      <camelContext
> id="document-logic-service"xmlns="http://camel.apache.org/schema/blueprint">
>          <routeBuilder ref="firstRouteBuilder"/>
>          <routeBuilder ref="secondRouteBuilder"/>
>      </camelContext>
> 
> The RouteBuilders can be independently unit tested then with
> CamelTestSupport outside the Blueprint container.
> 
> This also allows an injection and setup to take place for your route
> builders when they are instantiated and then when the Camel context is given
> their reference. Without that step Camel and Felix/Karaf are unaware of
> their existence.
> 
> If you can’t get the archetype to run and create a Camel Blueprint project
> for you, I’d Google around for a sample project that has the POM correct.
> 
> Generally I'll have a features file and configuration file associated with
> the project as well so that the features repository can be added and
> installed. There may be a better way to do this with profiles in Karaf 4 but
> I'm a bit behind the times in that regard.
> 
> Ranx
> 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

Re: Running Camel in a Karaf OSGi container

Posted by Ranx <ra...@enjekt.org>.
You'll want to use the bundle plugin and create a blueprint.xml to bootstrap
your Camel Java DSL. I use the Camel Java DSL all the time in Blueprint for
a variety of reasons (testing is easier as the RouteBuilders exist without
the camel context). I’m not sure why your Camel blueprint archetype is
blowing up but I’d start with that first but then you’ll have to modify the
blueprint file to add your 

Here's a snippet:


<bean class="foo.bar.MyFirstRouteBuilder" id="firstRouteBuilder"/>  
<bean class="foo.bar.MySecondRouteBuilder" id="secondRouteBuilder"/>

    
    <camelContext
id="document-logic-service"xmlns="http://camel.apache.org/schema/blueprint">
        <routeBuilder ref="firstRouteBuilder"/>
        <routeBuilder ref="secondRouteBuilder"/>
    </camelContext>

The RouteBuilders can be independently unit tested then with
CamelTestSupport outside the Blueprint container.

This also allows an injection and setup to take place for your route
builders when they are instantiated and then when the Camel context is given
their reference. Without that step Camel and Felix/Karaf are unaware of
their existence.

If you can’t get the archetype to run and create a Camel Blueprint project
for you, I’d Google around for a sample project that has the POM correct.

Generally I'll have a features file and configuration file associated with
the project as well so that the features repository can be added and
installed. There may be a better way to do this with profiles in Karaf 4 but
I'm a bit behind the times in that regard. 

Ranx




--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Running Camel in a Karaf OSGi container

Posted by "John F. Berry" <bo...@yahoo.com>.
This is just the maven 3.5.3 default generated archetype choosing archetype choice 1187 with version 2.22.1


On Tuesday, October 16, 2018, 4:28:43 PM EDT, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote: 





Hi


Can you share your pom and blueprint xml ?


You can find example on my GitHub about camel with blueprint.


Regards

JB

Le 16 oct. 2018, à 21:45, "John F. Berry" <bo...@yahoo.com> a écrit:
>  Thanks Francois for the info.  Now I will show my shallow knowledge of Karaf (or this Apache family for that matter).. What is the "bundle" that you drop in the deploy folder.. is it the entire project with all its directories?  I haven't successfully made this a blueprint camel project yet.. I make a blank one and cannot get it to install without an error (before I modify it):[         Blueprint Extender: 1] BlueprintContainerImpl         INFO  Blueprint bundle org.apache.aries.blueprint.core/1.10.0 has been started[         Blueprint Extender: 2] BlueprintContainerImpl         ERROR Unable to start container for blueprint bundle org.apache.camel.camel-blueprint/2.22.1org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to instantiate components________________________________
> 
> 
> From: Francois Papon <fr...@openobject.fr>
> To: user@karaf.apache.org 
> Sent: Tuesday, October 16, 2018 3:18 PM
> Subject: Re: Running Camel in a Karaf OSGi container
> 
> 
> 
> Hi John,
> Have you install the camel feature in Karaf ?
> In a Karaf shell : 
> 
> karaf@root()> feature:repo-add camel
> karaf@root()> feature:install camel
> If your are using blueprint with Karaf 4.2.x :
> karaf@root()> feature:install aries-blueprint
> 
> Then just drop your bundle into the "deploy" folder.
> 
> It would be nice if you can share your creation ;)
> regards,
> 
> François Papon fpapon@apache.org
> Le 16/10/2018 à 22:54, John F. Berry a écrit :
> 
> New user to Karaf due to the fact that my development work in Apache Camel is wanted by people to be installed on a Windows server and to be installed as a service.  This led me to the Karaf product.
> I've asked the Camel users forum about migration steps, but now I think this is more of a Karaf and/or maven deployment thing than a Camel issue.
> I have developed a route in Camel using maven and hand writing
>       a Java DSL route (no Eclipse or other tool).  I can run the
>       jar as a standalone execution fine from a command line.
> I did create a OSGi service wrapper in karaf and did have a
>       window service instance installed.
> I just cannot seem to get Karaf to "deploy" it (a.k.a. pick up
>       and run with it under that OSGi container that is running.
> Sorry for the generalities, new to the open source community
>       and the idea that you need to be fully immersed in every
>       Apache offering (Camel, Maven, Felix, ServiceMix, Karaf, 
>       etc.) to utilize any one of them  :P    I have felix and
>       blueprint dependencies in my POM.. but they been through many
>       different forms in an attempt to run it.  It is a Java DSL
>       Camel archetype that has been built, but cannot seem to
>       generate supporting files for Karaf to recognize my little
>       creation.
> Ideas?  
> Later I attempted to make an "empty" project with maven selecting "org.apache.camel.archetypes:camel-archetype-blueprint", but I cannot even get that base package to run (the small Hello World code) without java blowing up.  The one I built, compiled, ran, tested and "jar"ed was from the "org.apache.camel.archetypes:camel-archetype-java" maven archetype skeleton.  I attempted to merge the two.. but no luck so far!
> 
> Thanks!

Re: Running Camel in a Karaf OSGi container

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi

Can you share your pom and blueprint xml ?

You can find example on my GitHub about camel with blueprint.

Regards
JB

Le 16 oct. 2018 à 21:45, à 21:45, "John F. Berry" <bo...@yahoo.com> a écrit:
>Thanks Francois for the info.  Now I will show my shallow knowledge of
>Karaf (or this Apache family for that matter).. 
>What is the "bundle" that you drop in the deploy folder.. is it the
>entire project with all its directories?  
>I haven't successfully made this a blueprint camel project yet.. I make
>a blank one and cannot get it to install without an error (before I
>modify it):
>
>[         Blueprint Extender: 1] BlueprintContainerImpl         INFO 
>Blueprint bundle org.apache.aries.blueprint.core/1.10.0 has been
>started
>[         Blueprint Extender: 2] BlueprintContainerImpl         ERROR
>Unable to start container for blueprint bundle
>org.apache.camel.camel-blueprint/2.22.1
>org.osgi.service.blueprint.container.ComponentDefinitionException:
>Unable to instantiate components
>
>________________________________
>
>From: Francois Papon <fr...@openobject.fr>
>To: user@karaf.apache.org 
>Sent: Tuesday, October 16, 2018 3:18 PM
>Subject: Re: Running Camel in a Karaf OSGi container
>
>
>
>Hi John,
>Have you install the camel feature in Karaf ?
>In a Karaf shell : 
>
>karaf@root()> feature:repo-add camel
>karaf@root()> feature:install camel
>If your are using blueprint with Karaf 4.2.x :
>karaf@root()> feature:install aries-blueprint
>
>Then just drop your bundle into the "deploy" folder.
>
>It would be nice if you can share your creation ;)
>regards,
>
>François Papon fpapon@apache.org
>Le 16/10/2018 à 22:54, John F. Berry a écrit :
>
>New user to Karaf due to the fact that my development work in Apache
>Camel is wanted by people to be installed on a Windows server and to be
>installed as a service.  This led me to the Karaf product.
>I've asked the Camel users forum about migration steps, but now I think
>this is more of a Karaf and/or maven deployment thing than a Camel
>issue.
>I have developed a route in Camel using maven and hand writing
>      a Java DSL route (no Eclipse or other tool).  I can run the
>      jar as a standalone execution fine from a command line.
>I did create a OSGi service wrapper in karaf and did have a
>      window service instance installed.
>I just cannot seem to get Karaf to "deploy" it (a.k.a. pick up
>      and run with it under that OSGi container that is running.
>Sorry for the generalities, new to the open source community
>      and the idea that you need to be fully immersed in every
>      Apache offering (Camel, Maven, Felix, ServiceMix, Karaf, 
>      etc.) to utilize any one of them  :P    I have felix and
>      blueprint dependencies in my POM.. but they been through many
>      different forms in an attempt to run it.  It is a Java DSL
>      Camel archetype that has been built, but cannot seem to
>      generate supporting files for Karaf to recognize my little
>      creation.
>Ideas?  
>Later I attempted to make an "empty" project with maven selecting
>"org.apache.camel.archetypes:camel-archetype-blueprint", but I cannot
>even get that base package to run (the small Hello World code) without
>java blowing up.  The one I built, compiled, ran, tested and "jar"ed
>was from the "org.apache.camel.archetypes:camel-archetype-java" maven
>archetype skeleton.  I attempted to merge the two.. but no luck so far!
>
>Thanks!

Re: Running Camel in a Karaf OSGi container

Posted by "John F. Berry" <bo...@yahoo.com>.
Thanks Francois for the info.  Now I will show my shallow knowledge of Karaf (or this Apache family for that matter).. 
What is the "bundle" that you drop in the deploy folder.. is it the entire project with all its directories?  
I haven't successfully made this a blueprint camel project yet.. I make a blank one and cannot get it to install without an error (before I modify it):

[         Blueprint Extender: 1] BlueprintContainerImpl         INFO  Blueprint bundle org.apache.aries.blueprint.core/1.10.0 has been started
[         Blueprint Extender: 2] BlueprintContainerImpl         ERROR Unable to start container for blueprint bundle org.apache.camel.camel-blueprint/2.22.1
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to instantiate components

________________________________

From: Francois Papon <fr...@openobject.fr>
To: user@karaf.apache.org 
Sent: Tuesday, October 16, 2018 3:18 PM
Subject: Re: Running Camel in a Karaf OSGi container



Hi John,
Have you install the camel feature in Karaf ?
In a Karaf shell : 

karaf@root()> feature:repo-add camel
karaf@root()> feature:install camel
If your are using blueprint with Karaf 4.2.x :
karaf@root()> feature:install aries-blueprint

Then just drop your bundle into the "deploy" folder.

It would be nice if you can share your creation ;)
regards,

François Papon fpapon@apache.org
Le 16/10/2018 à 22:54, John F. Berry a écrit :

New user to Karaf due to the fact that my development work in Apache Camel is wanted by people to be installed on a Windows server and to be installed as a service.  This led me to the Karaf product.
I've asked the Camel users forum about migration steps, but now I think this is more of a Karaf and/or maven deployment thing than a Camel issue.
I have developed a route in Camel using maven and hand writing
      a Java DSL route (no Eclipse or other tool).  I can run the
      jar as a standalone execution fine from a command line.
I did create a OSGi service wrapper in karaf and did have a
      window service instance installed.
I just cannot seem to get Karaf to "deploy" it (a.k.a. pick up
      and run with it under that OSGi container that is running.
Sorry for the generalities, new to the open source community
      and the idea that you need to be fully immersed in every
      Apache offering (Camel, Maven, Felix, ServiceMix, Karaf, 
      etc.) to utilize any one of them  :P    I have felix and
      blueprint dependencies in my POM.. but they been through many
      different forms in an attempt to run it.  It is a Java DSL
      Camel archetype that has been built, but cannot seem to
      generate supporting files for Karaf to recognize my little
      creation.
Ideas?  
Later I attempted to make an "empty" project with maven selecting "org.apache.camel.archetypes:camel-archetype-blueprint", but I cannot even get that base package to run (the small Hello World code) without java blowing up.  The one I built, compiled, ran, tested and "jar"ed was from the "org.apache.camel.archetypes:camel-archetype-java" maven archetype skeleton.  I attempted to merge the two.. but no luck so far!

Thanks!

Re: Running Camel in a Karaf OSGi container

Posted by Francois Papon <fr...@openobject.fr>.
Hi John,

Have you install the camel feature in Karaf ?

In a Karaf shell :

karaf@root()> feature:repo-add camel

karaf@root()> feature:install camel

If your are using blueprint with Karaf 4.2.x :

karaf@root()> feature:install aries-blueprint

Then just drop your bundle into the "deploy" folder.

It would be nice if you can share your creation ;)

regards,

François Papon
fpapon@apache.org

Le 16/10/2018 à 22:54, John F. Berry a écrit :
> New user to Karaf due to the fact that my development work in Apache
> Camel is wanted by people to be installed on a Windows server and to
> be installed as a service.  This led me to the Karaf product.
> I've asked the Camel users forum about migration steps, but now I
> think this is more of a Karaf and/or maven deployment thing than a
> Camel issue.
> I have developed a route in Camel using maven and hand writing a Java
> DSL route (no Eclipse or other tool).  I can run the jar as a
> standalone execution fine from a command line.
> I did create a OSGi service wrapper in karaf and did have a window
> service instance installed.
> I just cannot seem to get Karaf to "deploy" it (a.k.a. pick up and run
> with it under that OSGi container that is running.
> Sorry for the generalities, new to the open source community and the
> idea that you need to be fully immersed in every Apache offering
> (Camel, Maven, Felix, ServiceMix, Karaf,  etc.) to utilize any one of
> them  :P    I have felix and blueprint dependencies in my POM.. but
> they been through many different forms in an attempt to run it.  It is
> a Java DSL Camel archetype that has been built, but cannot seem to
> generate supporting files for Karaf to recognize my little creation.
> Ideas? 
> Later I attempted to make an "empty" project with maven selecting
> "org.apache.camel.archetypes:camel-archetype-blueprint", but I cannot
> even get that base package to run (the small Hello World code) without
> java blowing up.  The one I built, compiled, ran, tested and "jar"ed
> was from the "org.apache.camel.archetypes:camel-archetype-java" maven
> archetype skeleton.  I attempted to merge the two.. but no luck so far!
>
> Thanks!
>


Re: Running Camel in a Karaf OSGi container

Posted by "John F. Berry" <bo...@yahoo.com>.
 Thanks Kerry, 

So if I read your project right.. you have 4 apps/utility you made in this one "project"?If so, this looks like a good fit for what I want to do.  I do have call for a few more routing tasks that don't have relation to each other, but assembled nicely like your example and I'd like deployed out to simply handle their own traffic, in theory, an OSGi container.So my current project is Java DSL, which Karaf doesn't like, and I have a blank "example only" camel-blueprint maven project that won't even execute, so I fear I am a long way from what you've accomplished.My plan was to regroup.. forget the Java DSL (except for the route logic as a reference)  and start again with camel blueprint.. one route step at a time.. accomplish receiving and acknowledge the message.. then add parsing.. then add code to mess with the message body.. each time making sure I didn't blow up the code.. The only thing is that the camel blueprint code is blowing up before I lay a keystroke onto it.. So I'm kind of stuck..I also planned to deploy the most basic skeleton of a project to check execution of camel and Karaf, making sure the route is still intact with every code addition.. I just cannot get off the base with the camel blueprint.
Is this the base archetype to start with (to begin making a Karaf compatible project)?Does this archetype include too much baggage (like the contained examplein the maven generated project)?Is there a better example of the most basic Camel route that is configured to be deployed for Karaf that just presents to me a beginning "Camel Context" to start into?
I'd like to get fancy and simple and organized, but given my struggles, I am quite new to the "open source" environment here and just need to get something to "stick"
Thanks!


    On Tuesday, October 16, 2018, 4:11:52 PM EDT, Kerry <ka...@avionicengineers.com> wrote:  
 
 Hi John,

You might like to cast your eye over a camel example I made for myself a little while ago:

https://github.com/jtkb/cameltest

It might help give you a few pointers in the right direction. I haven't used if for a while so it might not work 'out-of-the-box' but the code might help you.

Kerry


On 16/10/18 20:36, John F. Berry wrote:
> I'd love to share my code.. just make sure to have your Alka-Seltzer ready  :P
> This is my original route using Java DSL to solve a small route issue. (I did anonymize a few things in the code before sending it out to public view)  I've tried to "fortify" it with dependencies and configurations to try and flip it over to something Karaf can make heads or tails of.  
> Thanks!
>
>
> ________________________________
> From: Kerry <ka...@avionicengineers.com>
> To: user@karaf.apache.org 
> Sent: Tuesday, October 16, 2018 3:03 PM
> Subject: Re: Running Camel in a Karaf OSGi container
>
>
>
> Hi John,
> Are you able to share any of your code or an example project? also are you familiar already with OSGi or is it only Karaf that you are new to?
> thanks
> Kerry
>
>
> On 16/10/18 19:54, John F. Berry wrote:
>
> New user to Karaf due to the fact that my development work in Apache Camel is wanted by people to be installed on a Windows server and to be installed as a service.  This led me to the Karaf product.
> I've asked the Camel users forum about migration steps, but now I think this is more of a Karaf and/or maven deployment thing than a Camel issue.
> I have developed a route in Camel using maven and hand writing
>        a Java DSL route (no Eclipse or other tool).  I can run the
>        jar as a standalone execution fine from a command line.
> I did create a OSGi service wrapper in karaf and did have a
>        window service instance installed.
> I just cannot seem to get Karaf to "deploy" it (a.k.a. pick up
>        and run with it under that OSGi container that is running.
> Sorry for the generalities, new to the open source community
>        and the idea that you need to be fully immersed in every
>        Apache offering (Camel, Maven, Felix, ServiceMix, Karaf, 
>        etc.) to utilize any one of them  :P    I have felix and
>        blueprint dependencies in my POM.. but they been through many
>        different forms in an attempt to run it.  It is a Java DSL
>        Camel archetype that has been built, but cannot seem to
>        generate supporting files for Karaf to recognize my little
>        creation.
> Ideas?  
> Later I attempted to make an "empty" project with maven selecting "org.apache.camel.archetypes:camel-archetype-blueprint", but I cannot even get that base package to run (the small Hello World code) without java blowing up.  The one I built, compiled, ran, tested and "jar"ed was from the "org.apache.camel.archetypes:camel-archetype-java" maven archetype skeleton.  I attempted to merge the two.. but no luck so far!
>
> Thanks!

  

Re: Running Camel in a Karaf OSGi container

Posted by Kerry <ka...@avionicengineers.com>.
Hi John,

You might like to cast your eye over a camel example I made for myself a little while ago:

https://github.com/jtkb/cameltest

It might help give you a few pointers in the right direction. I haven't used if for a while so it might not work 'out-of-the-box' but the code might help you.

Kerry


On 16/10/18 20:36, John F. Berry wrote:
> I'd love to share my code.. just make sure to have your Alka-Seltzer ready  :P
> This is my original route using Java DSL to solve a small route issue. (I did anonymize a few things in the code before sending it out to public view)  I've tried to "fortify" it with dependencies and configurations to try and flip it over to something Karaf can make heads or tails of.  
> Thanks!
>
>
> ________________________________
> From: Kerry <ka...@avionicengineers.com>
> To: user@karaf.apache.org 
> Sent: Tuesday, October 16, 2018 3:03 PM
> Subject: Re: Running Camel in a Karaf OSGi container
>
>
>
> Hi John,
> Are you able to share any of your code or an example project? also are you familiar already with OSGi or is it only Karaf that you are new to?
> thanks
> Kerry
>
>
> On 16/10/18 19:54, John F. Berry wrote:
>
> New user to Karaf due to the fact that my development work in Apache Camel is wanted by people to be installed on a Windows server and to be installed as a service.  This led me to the Karaf product.
> I've asked the Camel users forum about migration steps, but now I think this is more of a Karaf and/or maven deployment thing than a Camel issue.
> I have developed a route in Camel using maven and hand writing
>        a Java DSL route (no Eclipse or other tool).  I can run the
>        jar as a standalone execution fine from a command line.
> I did create a OSGi service wrapper in karaf and did have a
>        window service instance installed.
> I just cannot seem to get Karaf to "deploy" it (a.k.a. pick up
>        and run with it under that OSGi container that is running.
> Sorry for the generalities, new to the open source community
>        and the idea that you need to be fully immersed in every
>        Apache offering (Camel, Maven, Felix, ServiceMix, Karaf, 
>        etc.) to utilize any one of them  :P    I have felix and
>        blueprint dependencies in my POM.. but they been through many
>        different forms in an attempt to run it.  It is a Java DSL
>        Camel archetype that has been built, but cannot seem to
>        generate supporting files for Karaf to recognize my little
>        creation.
> Ideas?  
> Later I attempted to make an "empty" project with maven selecting "org.apache.camel.archetypes:camel-archetype-blueprint", but I cannot even get that base package to run (the small Hello World code) without java blowing up.  The one I built, compiled, ran, tested and "jar"ed was from the "org.apache.camel.archetypes:camel-archetype-java" maven archetype skeleton.  I attempted to merge the two.. but no luck so far!
>
> Thanks!


Re: Running Camel in a Karaf OSGi container

Posted by "John F. Berry" <bo...@yahoo.com>.
I'd love to share my code.. just make sure to have your Alka-Seltzer ready  :P
This is my original route using Java DSL to solve a small route issue. (I did anonymize a few things in the code before sending it out to public view)  I've tried to "fortify" it with dependencies and configurations to try and flip it over to something Karaf can make heads or tails of.  
Thanks!


________________________________
From: Kerry <ka...@avionicengineers.com>
To: user@karaf.apache.org 
Sent: Tuesday, October 16, 2018 3:03 PM
Subject: Re: Running Camel in a Karaf OSGi container



Hi John,
Are you able to share any of your code or an example project? also are you familiar already with OSGi or is it only Karaf that you are new to?
thanks
Kerry


On 16/10/18 19:54, John F. Berry wrote:

New user to Karaf due to the fact that my development work in Apache Camel is wanted by people to be installed on a Windows server and to be installed as a service.  This led me to the Karaf product.
I've asked the Camel users forum about migration steps, but now I think this is more of a Karaf and/or maven deployment thing than a Camel issue.
I have developed a route in Camel using maven and hand writing
       a Java DSL route (no Eclipse or other tool).  I can run the
       jar as a standalone execution fine from a command line.
I did create a OSGi service wrapper in karaf and did have a
       window service instance installed.
I just cannot seem to get Karaf to "deploy" it (a.k.a. pick up
       and run with it under that OSGi container that is running.
Sorry for the generalities, new to the open source community
       and the idea that you need to be fully immersed in every
       Apache offering (Camel, Maven, Felix, ServiceMix, Karaf, 
       etc.) to utilize any one of them  :P    I have felix and
       blueprint dependencies in my POM.. but they been through many
       different forms in an attempt to run it.  It is a Java DSL
       Camel archetype that has been built, but cannot seem to
       generate supporting files for Karaf to recognize my little
       creation.
Ideas?  
Later I attempted to make an "empty" project with maven selecting "org.apache.camel.archetypes:camel-archetype-blueprint", but I cannot even get that base package to run (the small Hello World code) without java blowing up.  The one I built, compiled, ran, tested and "jar"ed was from the "org.apache.camel.archetypes:camel-archetype-java" maven archetype skeleton.  I attempted to merge the two.. but no luck so far!

Thanks!

Re: Running Camel in a Karaf OSGi container

Posted by Kerry <ka...@avionicengineers.com>.
Hi John,

Are you able to share any of your code or an example project? also are you familiar already with OSGi or is it only Karaf that you are new to?

thanks

Kerry


On 16/10/18 19:54, John F. Berry wrote:
> New user to Karaf due to the fact that my development work in Apache Camel is wanted by people to be installed on a Windows server and to be installed as a service.  This led me to the Karaf product.
> I've asked the Camel users forum about migration steps, but now I think this is more of a Karaf and/or maven deployment thing than a Camel issue.
> I have developed a route in Camel using maven and hand writing a Java DSL route (no Eclipse or other tool).  I can run the jar as a standalone execution fine from a command line.
> I did create a OSGi service wrapper in karaf and did have a window service instance installed.
> I just cannot seem to get Karaf to "deploy" it (a.k.a. pick up and run with it under that OSGi container that is running.
> Sorry for the generalities, new to the open source community and the idea that you need to be fully immersed in every Apache offering (Camel, Maven, Felix, ServiceMix, Karaf,  etc.) to utilize any one of them  :P    I have felix and blueprint dependencies in my POM.. but they been through many different forms in an attempt to run it.  It is a Java DSL Camel archetype that has been built, but cannot seem to generate supporting files for Karaf to recognize my little creation.
> Ideas? 
> Later I attempted to make an "empty" project with maven selecting "org.apache.camel.archetypes:camel-archetype-blueprint", but I cannot even get that base package to run (the small Hello World code) without java blowing up.  The one I built, compiled, ran, tested and "jar"ed was from the "org.apache.camel.archetypes:camel-archetype-java" maven archetype skeleton.  I attempted to merge the two.. but no luck so far!
>
> Thanks!
>