1 Star 0 Fork 1

zhouanan511/camel-spring-boot-examples2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README.adoc 1.57 KB
一键复制 编辑 原始数据 按行查看 历史

Camel Spring Boot Metrics Example

Introduction

This example sends Camel route metrics to Graphite from a Spring Boot app.

Please read Configuration first

Build

You will need to compile this example first:

mvn install

Run

To run the example type

java -jar target/camel-example-spring-boot-metrics.jar

You will see logging from the Fast'' and Slow'' routes, and metrics will be sent to Graphite (or nc) every 5 seconds.

Configuration

Spring Boot auto-configures the com.codahale.metrics.MetricRegistry. See code comments in Application.java for further details.

If you already have a Graphite server, make sure that UDP is enabled (set ENABLE_UDP_LISTENER = True in carbon.conf).

If Graphite is not on your local machine, replace localhost in Application.java with the hostname or IP address of your Graphite server.

If you want to use TCP instead of UDP, use com.codahale.metrics.graphite.Graphite instead of com.codahale.metrics.graphite.GraphiteUDP, as shown here: http://metrics.dropwizard.io/3.1.0/manual/graphite/

If you can’t be bothered to set up a Graphite server right now, you can simulate it by running nc -ul 2003 on Linux. If you don’t have nc, use yum search netcat to find a suitable package to install (e.g. nmap-ncat.x86_64).

Help and contributions

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!

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhouanan511/camel-spring-boot-examples2.git
git@gitee.com:zhouanan511/camel-spring-boot-examples2.git
zhouanan511
camel-spring-boot-examples2
camel-spring-boot-examples2
camel-3.4.x

搜索帮助

0d507c66 1850385 C8b1a773 1850385