Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rmohr/camel-hystrix-endpoint

Camel endpoint which wraps child endpoints into a synchronous hystrix circuit breaker
https://github.com/rmohr/camel-hystrix-endpoint

Last synced: 14 days ago
JSON representation

Camel endpoint which wraps child endpoints into a synchronous hystrix circuit breaker

Awesome Lists containing this project

README

        

# camel-hystrix-endpoint

[![Build Status](https://travis-ci.org/jollydays/camel-hystrix-endpoint.svg?branch=master)](https://travis-ci.org/jollydays/camel-hystrix-endpoint)

Camel endpoint which wraps child endpoints into a synchronous hystrix circuit breaker.

This project allows easy integration of hystrix components into camel routes. A very simple example might look like this:

```java
private class TestRoute extends RouteBuilder {

@Override
public void configure() throws Exception {
onException(HystrixRuntimeException.class).handled(true).setBody().constant("error");

from("direct:start").to("hystrix:mock:protectedRoute?hystrixGroup=test?hystrixCommand=slowCommand");
}
}
```
In this example the mock endpoint is protected by a hystrix endpoint by prefixing the mock endpoint with __hystrix__.
The _hystrixGroup_ parameter can be used to identify and group hystrix commands for monitoring in scaled environments.
The _hystrixCommand_ parameter can be used to identify hystrix commands for distributed configuration of components.

When wrapping __direct__ endpoints with the hystrix component, whole sections of a route can be protected, including processors and endpoints:

```java
private class TestRoute extends RouteBuilder {

@Override
public void configure() throws Exception {
onException(HystrixRuntimeException.class).handled(true).setBody().constant("error");

from("direct:start").to("hystrix:direct:protectedRoute?hystrixGroup=test&hystrixCommand=slowCommand");
from("direct:protectedRoute").marsha().json().to("mock:result");
}
}
```

Binaries

Jars for Maven, Ivy, Gradle and others can be found at [http://search.maven.org](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.jollydays.camel%22%20AND%20a%3A%22camel-hystrix-endpoint%22).

Example for Maven:

```xml

com.jollydays.camel
camel-hystrix-endpoint
x.y.z

```