Skip to content

Commit 9bf6504

Browse files
authored
switch to kiwiproject consul-client (#548)
* switch to kiwiproject consul-client * Create switch-to-kiwiprojects.excludes * mima
1 parent 605fca9 commit 9bf6504

4 files changed

Lines changed: 37 additions & 12 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Issues caused by switch to org.kiwiprojects consul-client
19+
ProblemFilters.exclude[IncompatibleSignatureProblem]("org.apache.pekko.discovery.consul.ConsulServiceDiscovery.ConsulResponseFutureDecorator")
20+
ProblemFilters.exclude[MissingTypesProblem]("org.apache.pekko.discovery.consul.ConsulServiceDiscovery$ConsulResponseFutureCallback")
21+
ProblemFilters.exclude[IncompatibleSignatureProblem]("org.apache.pekko.discovery.consul.ConsulServiceDiscovery#ConsulResponseFutureCallback.fail")
22+
ProblemFilters.exclude[IncompatibleSignatureProblem]("org.apache.pekko.discovery.consul.ConsulServiceDiscovery#ConsulResponseFutureCallback.future")
23+
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.discovery.consul.ConsulServiceDiscovery#ConsulResponseFutureCallback.onComplete")
24+
ProblemFilters.exclude[IncompatibleSignatureProblem]("org.apache.pekko.discovery.consul.ConsulServiceDiscovery#ConsulResponseFutureDecorator.asFuture")
25+
ProblemFilters.exclude[IncompatibleSignatureProblem]("org.apache.pekko.discovery.consul.ConsulServiceDiscovery#ConsulResponseFutureDecorator.this")

discovery-consul/src/main/scala/org/apache/pekko/discovery/consul/ConsulServiceDiscovery.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414
package org.apache.pekko.discovery.consul
1515

1616
import com.google.common.net.HostAndPort
17-
import com.orbitz.consul.Consul
18-
import com.orbitz.consul.async.ConsulResponseCallback
19-
import com.orbitz.consul.model.ConsulResponse
20-
import com.orbitz.consul.model.catalog.CatalogService
21-
import com.orbitz.consul.option.QueryOptions
2217
import org.apache.pekko
2318
import pekko.actor.ActorSystem
2419
import pekko.annotation.ApiMayChange
2520
import pekko.discovery.ServiceDiscovery.{ Resolved, ResolvedTarget }
2621
import pekko.discovery.consul.ConsulServiceDiscovery._
2722
import pekko.discovery.{ Lookup, ServiceDiscovery }
2823
import pekko.pattern.after
24+
import org.kiwiproject.consul.Consul
25+
import org.kiwiproject.consul.async.ConsulResponseCallback
26+
import org.kiwiproject.consul.model.ConsulResponse
27+
import org.kiwiproject.consul.model.catalog.CatalogService
28+
import org.kiwiproject.consul.option.Options
2929

3030
import java.net.InetAddress
3131
import java.util
@@ -88,7 +88,7 @@ class ConsulServiceDiscovery(system: ActorSystem) extends ServiceDiscovery {
8888

8989
private def getService(name: String) =
9090
((callback: ConsulResponseCallback[util.List[CatalogService]]) =>
91-
consul.catalogClient().getService(name, QueryOptions.BLANK, callback)).asFuture
91+
consul.catalogClient().getService(name, Options.BLANK_QUERY_OPTIONS, callback)).asFuture
9292

9393
}
9494

discovery-consul/src/test/scala/org/apache/pekko/cluster/bootstrap/discovery/ConsulDiscoverySpec.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
package org.apache.pekko.cluster.bootstrap.discovery
1515

1616
import com.google.common.net.HostAndPort
17-
import com.orbitz.consul.Consul
18-
import com.orbitz.consul.model.catalog.ImmutableCatalogRegistration
19-
import com.orbitz.consul.model.health.ImmutableService
2017
import com.typesafe.config.ConfigFactory
2118
import org.apache.pekko
2219
import pekko.actor.ActorSystem
2320
import pekko.discovery.ServiceDiscovery.ResolvedTarget
2421
import pekko.discovery.consul.ConsulServiceDiscovery
2522
import pekko.testkit.TestKitBase
23+
import org.kiwiproject.consul.Consul
24+
import org.kiwiproject.consul.model.catalog.ImmutableCatalogRegistration
25+
import org.kiwiproject.consul.model.health.ImmutableService
2626
import org.scalatest.BeforeAndAfterAll
2727
import org.scalatest.concurrent.ScalaFutures
2828
import org.scalatest.matchers.should.Matchers
@@ -40,7 +40,7 @@ class ConsulDiscoverySpec
4040
with TestKitBase
4141
with ScalaFutures {
4242

43-
private val consul = new ConsulContainer("hashicorp/consul:1.15")
43+
private val consul = new ConsulContainer("hashicorp/consul:1.22")
4444
consul.start()
4545

4646
"Consul Discovery" should {

project/Dependencies.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ object Dependencies {
4747
val discoveryConsul = Seq(
4848
"org.apache.pekko" %% "pekko-actor" % pekkoVersion,
4949
"org.apache.pekko" %% "pekko-discovery" % pekkoVersion,
50-
"com.orbitz.consul" % "consul-client" % "1.5.3",
51-
"org.testcontainers" % "consul" % "1.21.3" % Test,
50+
"org.kiwiproject" % "consul-client" % "1.8.1",
51+
"org.testcontainers" % "testcontainers-consul" % "2.0.2" % Test,
5252
"org.scalatest" %% "scalatest" % scalaTestVersion % Test,
5353
"org.apache.pekko" %% "pekko-testkit" % pekkoVersion % Test,
5454
"org.apache.pekko" %% "pekko-slf4j" % pekkoVersion % Test,

0 commit comments

Comments
 (0)