同步操作将从 寒松/camel-spring-boot-examples2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
This example shows how to use Camel with Hystrix EIP as circuit breaker in Camel routes
The example includes three sub maven modules that implement
client
service1
service2
Where client → service1 client → service2 (fallback)
Service1 is configured in the
src/main/java/sample/camel/Service1Application.java
source code.
Service2 is configured in the
src/main/resources/application.properties
properties file.
Then using three different shells and run service1 and service2 before the client.
$ cd service1
$ mvn compile spring-boot:run
When service1 is ready then start service2
$ cd service2
$ mvn compile camel:run
And then start the client that calls service1 every second.
$ cd client
$ mvn compile spring-boot:run
You can then stop service1 and see that the client should fallback to call service2 in the Hystrix EIP circuit breaker. And then start service 1 again and see the Hystrix EIP go back to normal.
You should be able to visualize the state of the Hystrix Circuit Breaker in the Hystrix Web Console.
You can find instructions at Hystrix how to build and run the web console: https://github.com/Netflix/Hystrix/wiki/Dashboard
For example using gradle, you can then access the web console locally
at: http://localhost:7979/hystrix-dashboard
.
The stream is accessinble from the client at:
http://localhost:8080/hystrix.stream
which you can add as stream to
the web console and then you should see the circuit breakers. In the
screen shot below, we have just stopped service1, so the Hystrix EIP
will execute the fallback via network, which is calling service2
instead. If you start service 1 again then the Hystrix EIP should go
back to green again.
If you hit any problem using Camel or have some feedback, then please let us know.
We also love contributors, so get involved :-)
The Camel riders!
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。