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

Luca Burgazzoli updated CAMEL-17726:
------------------------------------
    Description: 
The camel-controlbus allow to control routes i.e. you can stop it.

In some circumstances it may be useful to stop a route as pat of the error 
handling strategy and let the health check report the application as not ready.

As example, one may think to do something like:

{code:java}
from("timer:tick")
        .routeId("main")
        .process(e -> { throw new RuntimeCamelException("error happended")); })
        
.errorHandler(deadLetterChannel("controlbus:route?routeId=current&action=stop"))
        .to("log:info?showAll=true");
{code}

This would result in the route being stopped but the health check won't report 
the application as not ready because:
- the RouteHealthCheck code would report the route as UNKNOWN
- the RouteError is cleared up when the route is stopped.

It may be useful to enrich the control-bus with some additional *failure* 
attributes, something like:

{code}
controlbus:route?routeId=current&action=stop&fail=true&propagateException=true"
{code}

Where:

* *fail=true* tells the control bus that the route should be stopped but also 
marked as failed
* *propagateException=true* tells the control bus that if the exchange is 
failed, the exception need to be propagated to the route

  was:
The camel-controlbus allow to control routes i.e. you can stop it.

In some circumstances it may be useful to stop a route as pat of the error 
handling strategy and let the health check report the application as not ready.

As example, one may think to do something like:

{code:java}
from("timer:tick")
        .routeId("main")
        .process(e -> { throw new RuntimeCamelException("error happended")); })
        
.errorHandler(deadLetterChannel("controlbus:route?routeId=current&action=stop"))
        .to("log:info?showAll=true");
{code}

This would result in the route being stopped but the health check won't report 
the application as not ready because:
- the RouteHealthCheck code would report the route as UNKNOWN
- the RouteError is cleared up when the route is stopped.

It may be useful to enrich the control-bus with some additional *failure* 
attributes, something like:

{code}
controlbus:route?routeId=current&action=stop&fail=true&propagateException=true"
{code}

Where:

# *fail=true* tells the control bus that the route should be stopped but also 
marked as failed
# *propagateException=true* tells the control bus that if the exchange is 
failed, the exception need to be propagated to the route


> route controller: allow to mark a route as failed
> -------------------------------------------------
>
>                 Key: CAMEL-17726
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17726
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-controlbus, camel-core
>            Reporter: Luca Burgazzoli
>            Priority: Minor
>
> The camel-controlbus allow to control routes i.e. you can stop it.
> In some circumstances it may be useful to stop a route as pat of the error 
> handling strategy and let the health check report the application as not 
> ready.
> As example, one may think to do something like:
> {code:java}
> from("timer:tick")
>         .routeId("main")
>         .process(e -> { throw new RuntimeCamelException("error happended")); 
> })
>         
> .errorHandler(deadLetterChannel("controlbus:route?routeId=current&action=stop"))
>         .to("log:info?showAll=true");
> {code}
> This would result in the route being stopped but the health check won't 
> report the application as not ready because:
> - the RouteHealthCheck code would report the route as UNKNOWN
> - the RouteError is cleared up when the route is stopped.
> It may be useful to enrich the control-bus with some additional *failure* 
> attributes, something like:
> {code}
> controlbus:route?routeId=current&action=stop&fail=true&propagateException=true"
> {code}
> Where:
> * *fail=true* tells the control bus that the route should be stopped but also 
> marked as failed
> * *propagateException=true* tells the control bus that if the exchange is 
> failed, the exception need to be propagated to the route



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to