[jira] Created: (CAMEL-1244) Add shutdown hook to Main.main()

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (CAMEL-1244) Add shutdown hook to Main.main()

JIRA jira@apache.org
Add shutdown hook to Main.main()
---------------------------------

                 Key: CAMEL-1244
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1244
             Project: Apache Camel
          Issue Type: Improvement
          Components: camel-core
            Reporter: Hari Gangadharan
            Priority: Trivial
             Fix For: Future


Add a shutdown hook to so that it shuts down gracefully on HUP signal.

http://www.nabble.com/Two-questions%3A-Stopping-Camel-and-intercept-before-retry-td21323127s22882.html


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-1244) Add shutdown hook to Main.main()

JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hari Gangadharan updated CAMEL-1244:
------------------------------------

    Attachment: patchfile

Here is a patch to gracefully shut down Camel on Hangup signal / Ctrl-C

Two more file (an interface and a class) to attach

> Add shutdown hook to Main.main()
> ---------------------------------
>
>                 Key: CAMEL-1244
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1244
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Hari Gangadharan
>            Priority: Trivial
>             Fix For: Future
>
>         Attachments: patchfile
>
>
> Add a shutdown hook to so that it shuts down gracefully on HUP signal.
> http://www.nabble.com/Two-questions%3A-Stopping-Camel-and-intercept-before-retry-td21323127s22882.html

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-1244) Add shutdown hook to Main.main()

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hari Gangadharan updated CAMEL-1244:
------------------------------------

    Attachment: HangupInterceptor.java
                Stopable.java

Interface Stopable and Class HangupInterceptor

> Add shutdown hook to Main.main()
> ---------------------------------
>
>                 Key: CAMEL-1244
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1244
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Hari Gangadharan
>            Priority: Trivial
>             Fix For: Future
>
>         Attachments: HangupInterceptor.java, patchfile, Stopable.java
>
>
> Add a shutdown hook to so that it shuts down gracefully on HUP signal.
> http://www.nabble.com/Two-questions%3A-Stopping-Camel-and-intercept-before-retry-td21323127s22882.html

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (CAMEL-1244) Add shutdown hook to Main.main()

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang reassigned CAMEL-1244:
-----------------------------------

    Assignee: Willem Jiang

> Add shutdown hook to Main.main()
> ---------------------------------
>
>                 Key: CAMEL-1244
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1244
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Hari Gangadharan
>            Assignee: Willem Jiang
>            Priority: Trivial
>             Fix For: Future
>
>         Attachments: HangupInterceptor.java, patchfile, Stopable.java
>
>
> Add a shutdown hook to so that it shuts down gracefully on HUP signal.
> http://www.nabble.com/Two-questions%3A-Stopping-Camel-and-intercept-before-retry-td21323127s22882.html

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1244) Add shutdown hook to Main.main()

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48653#action_48653 ]

Claus Ibsen commented on CAMEL-1244:
------------------------------------

Willem I think we could add a Main option so you can enable/disable the shutdown hook, with a sensible default. Maybe enabled.

And we might consider it overkill to add a Stopable interface, as its a JVM Shutdown.

I was wondering if Spring dont have something for this for people running Spring from a Main?

> Add shutdown hook to Main.main()
> ---------------------------------
>
>                 Key: CAMEL-1244
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1244
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Hari Gangadharan
>            Assignee: Willem Jiang
>            Priority: Trivial
>             Fix For: Future
>
>         Attachments: HangupInterceptor.java, patchfile, Stopable.java
>
>
> Add a shutdown hook to so that it shuts down gracefully on HUP signal.
> http://www.nabble.com/Two-questions%3A-Stopping-Camel-and-intercept-before-retry-td21323127s22882.html

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1244) Add shutdown hook to Main.main()

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48655#action_48655 ]

Willem Jiang commented on CAMEL-1244:
-------------------------------------

Yes, I am plan to remove the Stopable interface.
This Main class is also a part of camel:run plugin,  maybe it's the reason why we need to use this main class.

> Add shutdown hook to Main.main()
> ---------------------------------
>
>                 Key: CAMEL-1244
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1244
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Hari Gangadharan
>            Assignee: Willem Jiang
>            Priority: Trivial
>             Fix For: Future
>
>         Attachments: HangupInterceptor.java, patchfile, Stopable.java
>
>
> Add a shutdown hook to so that it shuts down gracefully on HUP signal.
> http://www.nabble.com/Two-questions%3A-Stopping-Camel-and-intercept-before-retry-td21323127s22882.html

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-1244) Add shutdown hook to Main.main()

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CAMEL-1244.
---------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: Future)
                   2.0.0
                   1.5.1

Applied patch with thanks to Hari.


> Add shutdown hook to Main.main()
> ---------------------------------
>
>                 Key: CAMEL-1244
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1244
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Hari Gangadharan
>            Assignee: Willem Jiang
>            Priority: Trivial
>             Fix For: 1.5.1, 2.0.0
>
>         Attachments: HangupInterceptor.java, patchfile, Stopable.java
>
>
> Add a shutdown hook to so that it shuts down gracefully on HUP signal.
> http://www.nabble.com/Two-questions%3A-Stopping-Camel-and-intercept-before-retry-td21323127s22882.html

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1244) Add shutdown hook to Main.main()

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48674#action_48674 ]

Willem Jiang commented on CAMEL-1244:
-------------------------------------

@Claus

I don't think there is any user don't want shutdown Camel context gracefully.
Let's just put the shutdown hook in the Main class by default (no enable/disable option).

> Add shutdown hook to Main.main()
> ---------------------------------
>
>                 Key: CAMEL-1244
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1244
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Hari Gangadharan
>            Assignee: Willem Jiang
>            Priority: Trivial
>             Fix For: 1.5.1, 2.0.0
>
>         Attachments: HangupInterceptor.java, patchfile, Stopable.java
>
>
> Add a shutdown hook to so that it shuts down gracefully on HUP signal.
> http://www.nabble.com/Two-questions%3A-Stopping-Camel-and-intercept-before-retry-td21323127s22882.html

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.