简体   繁体   中英

Jersey REST service as a proxy

I need to build a REST API (Jersey 2) that should act as a proxy to an external service for certain calls (all the urls with a certain path in it). I need to get some statistics out of those calls (number of invocations), so in addition to proxy the calls I need to have some small logic for all of them.

What would the best way to achieve this in jersey? I am not familiar with the Jersey framework, so I'll appreciate if anybody can point me to the right direction!

Thanks! Roberto

You could use the Metrics library. It works with Jersey and can get you a bunch of data points. http://metrics.codahale.com/

You could use Hystrix (from Netflix) within Jersey to achieve this. It provides very nice stats. Check this dashboard provided by Hystrix.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM