Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registering a HystrixEventNotifier #355

Closed
demian0311 opened this issue Dec 13, 2014 · 2 comments
Closed

Registering a HystrixEventNotifier #355

demian0311 opened this issue Dec 13, 2014 · 2 comments

Comments

@demian0311
Copy link

Is there an alternative way to give a HystrixCommand an instance of HystrixEventNotifier?

This JavaDoc leads me to believe it's on HystrixCommand.Setter but I don't see it implemented there.

     *  Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("GroupName"))
                .andCommandKey(HystrixCommandKey.Factory.asKey("CommandName"))
                .andEventNotifier(notifier);

https://github.com/Netflix/Hystrix/blob/master/hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommand.java#L160

I'd like to log events and possibly send to Graphite.

Thanks!

@mattrjacobs
Copy link
Contributor

I believe this Javadoc is wrong. HystrixPlugins.registerEventNotifier is the way to attach an EventNotifier to HystrixCommands. When you register it this way, all instances of HystrixCommand use it. Does that work for your use case?

I'll create a PR to fix the Javadoc.

@demian0311
Copy link
Author

Works great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants