This example show how to use Camel with ServiceCall EIP with spring-cloud and consul.
This example includes two maven modules:
service that exposes a number of services
consumer that consumes services
The consumer is configured in the src/main/resources/application.properties
Using multiple shells:
start consul:
$ cd service $ src/main/bash/consul-run-linux.sh (for linux) $ src/main/bash/consul-run-osx.sh (for mac osx)
start the service:
$ cd service $ mvn spring-boot:run
start the consumer
$ cd consumer $ mvn spring-boot:run
In a new shell:
$ curl localhost:8080/camel/serviceCall/service1 Hi!, I'm service-1 on camel-1/route1 $ curl localhost:8080/camel/serviceCall/service2 Hi!, I'm service-1 on camel-1/route2
If you keep calling the http endpoint you’ll notice they are consumed using a round robin policy and that only the services matching specific tags are consumed.
You can open the Consul web console
http://localhost:8500/ui
Where you can find information about the services and its state.
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!
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。