You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Max Bridgewater <ma...@gmail.com> on 2013/11/03 22:59:28 UTC
How to Deploy new Camel Context with Hawtio
Hi Gents,
I understand this is not a Hawtio forum. Please indulge. Is there a way to
use Hawtio to deploy new camel contexts into Camel? When I deploy Hawtio, I
see that there is a default camel context running with two routes. How do I
add another route? Or how do I deploy a completely different camel context?
I also saw that I could edit and create new Camel context using the Wiki.
But I am not able to find a way to deploy these context.
Please help!
Thanks.
Max.
Re: How to Deploy new Camel Context with Hawtio
Posted by James Strachan <ja...@gmail.com>.
As I said; the easiest thing is to just use Fuse Fabric as we've lots of
documentation and out of the box examples that just work. However if you
want to use the spring watcher directly try this:
Try putting a spring camel XML file inside the spring folder (not /sping)
within the git repo?
e.g. here's a sample git repo for hawtio (which is used by default when you
use hawtio, so there should be this file there already?):
https://github.com/hawtio/hawtio-config
here's the watched spring XMLs
https://github.com/hawtio/hawtio-config/tree/master/spring
So try edit that camel XML there?
If you run hawtio via this command in the hawtio/hawtio-web directory
(assuming you've setup your machine with npm / typescript:
https://github.com/hawtio/hawtio/blob/master/BUILDING.md#installing-local-dependencies
)
mvn test-compile exec:java
then you will be able to edit this camel XML file via this URL:
http://localhost:8080/hawtio/#/wiki/branch/master/camel/canvas/spring/camel-spring.xml
when you hit save, you'll see in the log the route change (e.g. try edit
the Log statement to make it even more obvious).
Or change this blueprint XML file to watch the entire git repo if you
refer; e.g. change this to "${hawtio.config.dir}" instead of
"${hawtio.config.dir}/spring"
https://github.com/hawtio/hawtio/blob/master/hawtio-watcher-spring-context/src/main/resources/OSGI-INF/blueprint/blueprint.xml#L7-7
more detail on hawtio config here:
http://hawt.io/configuration/index.html
On 6 November 2013 01:00, Klaus777 <ma...@gmail.com> wrote:
> Also, to make sure it is not a compatibility issue, I took
>
> https://oss.sonatype.org/content/repositories/public/io/hawt/sample/1.2-M27/sample-1.2-M27.war
> ,
> and inserted the following JAR into its WEB-INF/lib folder:
>
> https://oss.sonatype.org/content/repositories/public/io/hawt/hawtio-watcher-spring-context/1.2-M27/hawtio-watcher-spring-context-1.2-M27.jar
>
> I also created an additional camel context
> /sping/mypersonal-camelcontext.xml. I declared a camel context in this file
> with a different id.
>
>
> Still no change in the deployed context.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-Deploy-new-Camel-Context-with-Hawtio-tp5742571p5742685.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
James
-------
Red Hat
Email: jstracha@redhat.com
Web: http://fusesource.com
Twitter: jstrachan, fusenews
Blog: http://macstrac.blogspot.com/
Open Source Integration
Re: How to Deploy new Camel Context with Hawtio
Posted by Klaus777 <ma...@gmail.com>.
Also, to make sure it is not a compatibility issue, I took
https://oss.sonatype.org/content/repositories/public/io/hawt/sample/1.2-M27/sample-1.2-M27.war,
and inserted the following JAR into its WEB-INF/lib folder:
https://oss.sonatype.org/content/repositories/public/io/hawt/hawtio-watcher-spring-context/1.2-M27/hawtio-watcher-spring-context-1.2-M27.jar
I also created an additional camel context
/sping/mypersonal-camelcontext.xml. I declared a camel context in this file
with a different id.
Still no change in the deployed context.
--
View this message in context: http://camel.465427.n5.nabble.com/How-to-Deploy-new-Camel-Context-with-Hawtio-tp5742571p5742685.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to Deploy new Camel Context with Hawtio
Posted by Klaus777 <ma...@gmail.com>.
Here is what i did. I took the jar file from here:
http://repo1.maven.org/maven2/io/hawt/hawtio-watcher-spring-context/1.2-M10/hawtio-watcher-spring-context-1.2-M10.jar
then I added it to the WB-INF/lib folder of the hawtio sample war file. I
deployed and created new routes in wiki/camel-spring.xml.
Still nothing is changing in the deployed camel context. I still see only
the default two routes.
Then I added a route to wiki/camel.xml. Still i don't see them appearing.
Please let me know what I am missing.
--
View this message in context: http://camel.465427.n5.nabble.com/How-to-Deploy-new-Camel-Context-with-Hawtio-tp5742571p5742682.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to Deploy new Camel Context with Hawtio
Posted by James Strachan <ja...@gmail.com>.
Just create your own WAR inheriting from the hawtio-base or hawtio-default
wars:
https://github.com/hawtio/hawtio/blob/master/sample/pom.xml#L17
then add the jar dependency like this (its currently commented out in the
sample project)
https://github.com/hawtio/hawtio/blob/master/sample/pom.xml#L60
On 4 November 2013 12:01, Klaus777 <ma...@gmail.com> wrote:
> Thanks a lot. Let's say I want to go the spring watcher way. I am quite
> confuse as to how to use this library:
> https://github.com/hawtio/hawtio/tree/master/hawtio-watcher-spring-context
>
> I was expecting it to be a war file that I would drop in my web container.
> Instead, the POM does not actually have packaging type.
>
> Would you mind please sharing some ideas on how to use this in my web
> container? Do I have to rebuild hawtio including this as a jar file?
>
> Max.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-Deploy-new-Camel-Context-with-Hawtio-tp5742571p5742588.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
James
-------
Red Hat
Email: jstracha@redhat.com
Web: http://fusesource.com
Twitter: jstrachan, fusenews
Blog: http://macstrac.blogspot.com/
Open Source Integration
Re: How to Deploy new Camel Context with Hawtio
Posted by Klaus777 <ma...@gmail.com>.
Thanks a lot. Let's say I want to go the spring watcher way. I am quite
confuse as to how to use this library:
https://github.com/hawtio/hawtio/tree/master/hawtio-watcher-spring-context
I was expecting it to be a war file that I would drop in my web container.
Instead, the POM does not actually have packaging type.
Would you mind please sharing some ideas on how to use this in my web
container? Do I have to rebuild hawtio including this as a jar file?
Max.
--
View this message in context: http://camel.465427.n5.nabble.com/How-to-Deploy-new-Camel-Context-with-Hawtio-tp5742571p5742588.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to Deploy new Camel Context with Hawtio
Posted by James Strachan <ja...@gmail.com>.
To be able to add/update/remove camel contexts based on changes to the
hawtio wiki, you either need to run a Fuse Fabric (which automatically
adds/updates/removes any bundles running blueprint/spring XML in a
container if its updated in the profile's wiki directory) or run a
spring/blueprint watcher which detects changes in the wiki (the underlying
git repo) and redeploys the spring/blueprint contexts.
e.g. if you're not using a Fuse Fabric and are using spring, deploy this
jar into your container
https://github.com/hawtio/hawtio/tree/master/hawtio-watcher-spring-context
which defaults to watching the spring directory in the wiki for any spring
XML files to deploy/update (including camel spring XML files, ActiveMQ
spring XML files, CXF spring XML files etc)
On 3 November 2013 21:59, Max Bridgewater <ma...@gmail.com> wrote:
> Hi Gents,
>
> I understand this is not a Hawtio forum. Please indulge. Is there a way to
> use Hawtio to deploy new camel contexts into Camel? When I deploy Hawtio, I
> see that there is a default camel context running with two routes. How do I
> add another route? Or how do I deploy a completely different camel context?
> I also saw that I could edit and create new Camel context using the Wiki.
> But I am not able to find a way to deploy these context.
>
> Please help!
>
> Thanks.
> Max.
>
--
James
-------
Red Hat
Email: jstracha@redhat.com
Web: http://fusesource.com
Twitter: jstrachan, fusenews
Blog: http://macstrac.blogspot.com/
Open Source Integration