Skip to content

Commit

Permalink
bump up all the versions, use the latest k8s api, and always log the …
Browse files Browse the repository at this point in the history
…number of services found
  • Loading branch information
Jesse White committed Apr 10, 2017
1 parent cd48e3f commit 8dbd705
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
<groupId>ca.jessewhite.activemq</groupId>
<artifactId>activemq-k8s-discovery</artifactId>
<packaging>jar</packaging>
<version>1.0.1</version>
<version>1.0.2</version>
<name>activemq-k8s-discovery</name>
<url>https://github.com/j-white/activemq-k8s-discovery</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<activemq.version>5.14.1</activemq.version>
<kubernetes-client.version>1.4.14</kubernetes-client.version>
<activemq.version>5.14.4</activemq.version>
<kubernetes-client.version>2.2.13</kubernetes-client.version>
<junit.version>4.12</junit.version>
<slf4j.version>1.7.21</slf4j.version>
<slf4j.version>1.7.25</slf4j.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -47,7 +47,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<version>3.6.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
Expand All @@ -56,7 +56,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<version>3.0.0</version>
<configuration>
<!-- get all project dependencies -->
<descriptorRefs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,22 @@ public void run() {
.filter(svc -> !knownServices.contains(svc))
.collect(Collectors.toList());

// Add them
// Determine the list of services we need to remove
final List<String> servicesToRemove = knownServices.stream()
.filter(svc -> !availableServices.contains(svc))
.collect(Collectors.toList());

LOG.info("Found {} services: {} to add, and {} to remove.",
availableServices.size(), servicesToAdd.size(), servicesToRemove.size());

// Add those that need adding
for (String service : servicesToAdd) {
LOG.info("Adding service: {}", service);
listener.onServiceAdd(new SimpleDiscoveryEvent(service));
knownServices.add(service);
}

// Determine the list of services we need to remove
final List<String> servicesToRemove = knownServices.stream()
.filter(svc -> !availableServices.contains(svc))
.collect(Collectors.toList());

// Remove them
// Remove those that need removing
for (String service : servicesToRemove) {
LOG.info("Removing service: {}", service);
listener.onServiceRemove(new SimpleDiscoveryEvent(service));
Expand Down

0 comments on commit 8dbd705

Please sign in to comment.