You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ch...@innogy.com on 2018/04/26 09:37:16 UTC

being informed in a routebuilder when camel is stopped

Hi there,

I have a route that opens a resource and keeps it open. However, when the camel context performs a soft shutdown, I want to release that resource. Therefore, I'm looking for a shutdown hook that is triggered to each route before the shutdown is performed.

I could not find a feature like that. Has anybody an idea?

Kind regards,
Christian Jacob

Innogy SE
Retail IT
Integration and Digital Solutions (AFS-IGI)
Rellinghauser Str. 37
45128 Essen
T intern: 70-20581
T extern: +49 (0)201 12 20582
T mobil: +49 (0)1622843981
Fax: +49 (0)201 12 24796
mailto: christian.jacob@innogy.com

----------------------------------------------------------------
innogy SE
Vorsitzender des Aufsichtsrates: Dr. Erhard Schipporeit
Vorstand: Uwe Tigges (Vorsitzender), Dr. Hans Buenting,
Dr. Bernhard Guenther, Martin Herrmann, Hildegard Mueller
Sitz der Gesellschaft: Essen, Eingetragen beim Amtsgericht Essen,
Handelsregister-Nr. HRB 27091, USt-IdNr. DE304171711

AW: being informed in a routebuilder when camel is stopped

Posted by ch...@innogy.com.
Hi Claus,

Route Policy was the way to do it. Many Thanks!
Kind regards,
Christian

-----Ursprüngliche Nachricht-----
Von: Claus Ibsen [mailto:claus.ibsen@gmail.com]
Gesendet: Donnerstag, 26. April 2018 12:59
An: users@camel.apache.org
Betreff: Re: being informed in a routebuilder when camel is stopped

Hi

You can use route policy, or event notifiers. You can find more information about them on the Camel website, by typing in these words in the tiny search box

On Thu, Apr 26, 2018 at 11:37 AM,  <ch...@innogy.com> wrote:
> Hi there,
>
> I have a route that opens a resource and keeps it open. However, when the camel context performs a soft shutdown, I want to release that resource. Therefore, I'm looking for a shutdown hook that is triggered to each route before the shutdown is performed.
>
> I could not find a feature like that. Has anybody an idea?
>
> Kind regards,
> Christian Jacob
>
> Innogy SE
> Retail IT
> Integration and Digital Solutions (AFS-IGI) Rellinghauser Str. 37
> 45128 Essen
> T intern: 70-20581
> T extern: +49 (0)201 12 20582
> T mobil: +49 (0)1622843981
> Fax: +49 (0)201 12 24796
> mailto: christian.jacob@innogy.com
>
> ----------------------------------------------------------------
> innogy SE
> Vorsitzender des Aufsichtsrates: Dr. Erhard Schipporeit
> Vorstand: Uwe Tigges (Vorsitzender), Dr. Hans Buenting, Dr. Bernhard
> Guenther, Martin Herrmann, Hildegard Mueller Sitz der Gesellschaft:
> Essen, Eingetragen beim Amtsgericht Essen, Handelsregister-Nr. HRB
> 27091, USt-IdNr. DE304171711



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
----------------------------------------------------------------
innogy SE
Vorsitzender des Aufsichtsrates: Dr. Erhard Schipporeit
Vorstand: Uwe Tigges (Vorsitzender), Dr. Hans Buenting,
Dr. Bernhard Guenther, Martin Herrmann, Hildegard Mueller
Sitz der Gesellschaft: Essen, Eingetragen beim Amtsgericht Essen,
Handelsregister-Nr. HRB 27091, USt-IdNr. DE304171711

Re: being informed in a routebuilder when camel is stopped

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can use route policy, or event notifiers. You can find more
information about them on the Camel website, by typing in these words
in the tiny search box

On Thu, Apr 26, 2018 at 11:37 AM,  <ch...@innogy.com> wrote:
> Hi there,
>
> I have a route that opens a resource and keeps it open. However, when the camel context performs a soft shutdown, I want to release that resource. Therefore, I'm looking for a shutdown hook that is triggered to each route before the shutdown is performed.
>
> I could not find a feature like that. Has anybody an idea?
>
> Kind regards,
> Christian Jacob
>
> Innogy SE
> Retail IT
> Integration and Digital Solutions (AFS-IGI)
> Rellinghauser Str. 37
> 45128 Essen
> T intern: 70-20581
> T extern: +49 (0)201 12 20582
> T mobil: +49 (0)1622843981
> Fax: +49 (0)201 12 24796
> mailto: christian.jacob@innogy.com
>
> ----------------------------------------------------------------
> innogy SE
> Vorsitzender des Aufsichtsrates: Dr. Erhard Schipporeit
> Vorstand: Uwe Tigges (Vorsitzender), Dr. Hans Buenting,
> Dr. Bernhard Guenther, Martin Herrmann, Hildegard Mueller
> Sitz der Gesellschaft: Essen, Eingetragen beim Amtsgericht Essen,
> Handelsregister-Nr. HRB 27091, USt-IdNr. DE304171711



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

Re: being informed in a routebuilder when camel is stopped

Posted by Zoran Regvart <zo...@regvart.com>.
Hi Christian,
I think the easiest way would be to add a Service to the route[1],
there is a handy ServiceSupport[2] base that you can use as a starting
point for your service.

zoran

[1] https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/Route.java#L126
[2] https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java

On Thu, Apr 26, 2018 at 11:37 AM,  <ch...@innogy.com> wrote:
> Hi there,
>
> I have a route that opens a resource and keeps it open. However, when the camel context performs a soft shutdown, I want to release that resource. Therefore, I'm looking for a shutdown hook that is triggered to each route before the shutdown is performed.
>
> I could not find a feature like that. Has anybody an idea?
>
> Kind regards,
> Christian Jacob
>
> Innogy SE
> Retail IT
> Integration and Digital Solutions (AFS-IGI)
> Rellinghauser Str. 37
> 45128 Essen
> T intern: 70-20581
> T extern: +49 (0)201 12 20582
> T mobil: +49 (0)1622843981
> Fax: +49 (0)201 12 24796
> mailto: christian.jacob@innogy.com
>
> ----------------------------------------------------------------
> innogy SE
> Vorsitzender des Aufsichtsrates: Dr. Erhard Schipporeit
> Vorstand: Uwe Tigges (Vorsitzender), Dr. Hans Buenting,
> Dr. Bernhard Guenther, Martin Herrmann, Hildegard Mueller
> Sitz der Gesellschaft: Essen, Eingetragen beim Amtsgericht Essen,
> Handelsregister-Nr. HRB 27091, USt-IdNr. DE304171711



-- 
Zoran Regvart