Skip to content

Commit

Permalink
Merge pull request #148 from brharrington/rxnetty-module
Browse files Browse the repository at this point in the history
use iep module to setup rxhttp client
  • Loading branch information
brharrington committed Apr 22, 2015
2 parents e8d1a85 + 3ad1891 commit acad26a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version_archaius1=0.6.6
version_archaius=2.0.0-rc.8
version_aws=1.9.23
version_iep=0.1.13.1
version_iep=0.1.16.4
version_jackson=2.5.2
version_log4j=2.2
version_ribbon=2.0.0
Expand Down
1 change: 1 addition & 0 deletions spectator-nflx-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies {
compile "com.google.inject:guice:3.0"
compile "com.netflix.archaius:archaius-core:$version_archaius1"
compile "com.netflix.eureka:eureka-client:1.1.147"
compile "com.netflix.iep-shadow:iepshadow-iep-module-rxnetty:$version_iep"
compile "com.netflix.iep-shadow:iepshadow-iep-rxhttp:$version_iep"
testCompile "com.netflix.governator:governator:1.3.3"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@
package com.netflix.spectator.nflx;

import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.netflix.discovery.DiscoveryClient;
import iep.com.netflix.iep.http.EurekaServerRegistry;
import iep.com.netflix.iep.http.RxHttp;
import iep.com.netflix.iep.http.ServerRegistry;
import com.netflix.spectator.api.ExtendedRegistry;
import com.netflix.spectator.api.Registry;
import com.netflix.spectator.api.Spectator;
import iep.com.netflix.iep.rxnetty.RxNettyModule;

/**
* Guice module to configure the appropriate bindings for running an application. Note that this
Expand Down Expand Up @@ -60,18 +56,12 @@
*/
public final class SpectatorModule extends AbstractModule {
@Override protected void configure() {
bind(RxHttp.class).asEagerSingleton();
install(new RxNettyModule());
bind(Plugin.class).asEagerSingleton();
bind(ExtendedRegistry.class).toInstance(Spectator.registry());
bind(Registry.class).toInstance(Spectator.registry());
}

/** Returns an instance of a server registry based on eureka. */
@Provides
public ServerRegistry getServerRegistry(DiscoveryClient client) {
return new EurekaServerRegistry(client);
}

@Override public boolean equals(Object obj) {
return obj != null && getClass().equals(obj.getClass());
}
Expand Down

0 comments on commit acad26a

Please sign in to comment.