Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Upgrade to 2.0.0 and improve stuff #29

Merged
merged 3 commits into from

2 participants

@Kami

Based on move_archaius_bindings_here branch.

@Kami Kami referenced this pull request
Merged

Move archaius bindings here #25

@gdusbabek

+1 ok.

@Kami Kami merged commit 36a0a32 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 27, 2013
  1. @Kami
  2. @Kami

    Style.

    Kami authored
  3. @Kami

    Add a null check.

    Kami authored
This page is out of date. Refresh to see the latest.
View
2  service-registry-archaius/pom.xml
@@ -62,7 +62,7 @@
<dependency>
<groupId>com.rackspacecloud</groupId>
<artifactId>service-registry-client</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
View
5 service-registry-archaius/src/main/java/com/netflix/config/sources/ServiceRegistryClientProvider.java
@@ -12,13 +12,14 @@
public ServiceRegistryClientProvider(String user, String key, String region) {
client = new Client(user, key, region);
}
+
@Override
public List<Service> getServices(String tag) throws Exception {
- return client.services.list(null, tag);
+ return client.getServicesClient().list(null, tag);
}
@Override
public List<ConfigurationValue> getConfiguration() throws Exception {
- return client.configuration.list(null);
+ return client.getConfigurationClient().list(null);
}
}
View
8 ...ice-registry-archaius/src/main/java/com/netflix/config/sources/ServiceRegistryConfigurationProvider.java
@@ -48,9 +48,15 @@ public PollResult poll(boolean initial, Object checkPoint)
for (String tag: serviceTags) {
Set<InetSocketAddress> pairs = new HashSet<InetSocketAddress>();
String key = PREFIX + DELIMITER + tag + DELIMITER + SUFFIX;
+
for (Service service : client.getServices(tag)) {
- pairs.add(getHostPortPair(service));
+ InetSocketAddress pair = getHostPortPair(service);
+
+ if (pair != null) {
+ pairs.add(pair);
+ }
}
+
if (!pairs.isEmpty()) {
map.put(key, StringUtils.join(pairs, SEPARATOR));
}
View
4 ...try-archaius/src/test/java/com/netflix/config/sources/test/ServiceRegistryConfigurationProviderTest.java
@@ -86,7 +86,7 @@ public void testPolling() throws Exception {
testInstance.addService(tag, ServiceRegistryConfigurationProvider.setHostPortPair(
host,
port,
- new Service("faux" + i, "fauxSession", Collections.singletonList(tag), new HashMap<String, String>())));
+ new Service("faux" + i, 15, Collections.singletonList(tag), new HashMap<String, String>())));
}
String key = ServiceRegistryConfigurationProvider.PREFIX + "." + tag + ".addresses";
pollOnce();
@@ -110,7 +110,7 @@ public void testPollingChanging() throws Exception {
testInstance.addService(tags[i], ServiceRegistryConfigurationProvider.setHostPortPair(
host + i + j,
port,
- new Service("faux" + i + j, "fauxSession", Collections.singletonList(tags[i]), new HashMap<String, String>())));
+ new Service("faux" + i + j, 15, Collections.singletonList(tags[i]), new HashMap<String, String>())));
Integer score = scoreboard.get(tags[i]);
Something went wrong with that request. Please try again.