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

Update sbt, scala and akka dependencies #25

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
4bfd347
Update scala versions
Apr 4, 2018
3cafc21
Update sbt version
Apr 4, 2018
d0e041d
Added ability to use only the healthy services for load balancing (#1)
ecyshor Sep 4, 2018
43e59fa
Updating deps and adding release possibilities
Dec 3, 2018
99d7241
Adding credentials
Dec 3, 2018
d808543
Setting version to 0.4.1
Dec 3, 2018
6f34399
Setting version to 0.4.2-SNAPSHOT
Dec 3, 2018
d622eb2
Version
Dec 3, 2018
2a262b6
x
Dec 3, 2018
f27922a
Setting version to 0.5.0
Dec 3, 2018
d7e7e23
Setting version to 0.5.1-SNAPSHOT
Dec 3, 2018
896b009
Removing println
sjoerdmulder Jan 2, 2019
20b0369
Setting version to 0.5.1
Jan 2, 2019
7b0fee0
Setting version to 0.5.2-SNAPSHOT
Jan 2, 2019
eec8632
Update to scala 2.13
Mar 26, 2020
abc8f7a
Setting version to 0.5.2
Mar 26, 2020
5d489f7
Setting version to 0.5.3-SNAPSHOT
Mar 26, 2020
58c3344
Updating build
Mar 26, 2020
3f46be9
Cleaning up project, upgrading project to latest standards
Nov 2, 2023
b37668b
Cleaning up project, upgrading project to latest standards
Nov 2, 2023
a3854a2
Cleaning up project, upgrading project to latest standards
Nov 2, 2023
86ac1db
Cleaning code
Nov 2, 2023
ea70fc7
First test is passing
Nov 2, 2023
6f3f92f
All tests are passing, working on IT tests now
Nov 2, 2023
a994637
IT tests are passing
Nov 2, 2023
ba1f56f
IT tests are passing
Nov 2, 2023
bef4062
Fixed logging
Nov 2, 2023
547c0f7
Fixing IT tests
Nov 2, 2023
5a4d455
Fixing IT tests
Nov 2, 2023
d4c5d54
Fixing IT tests
Nov 2, 2023
5cfa21f
Almost there, fixing last value
Nov 2, 2023
4fa0924
Fixed all tests
Nov 2, 2023
0edd5fd
Fixed all tests
Nov 2, 2023
f018d3e
Merge pull request #2 from crobox/feature/pekko
lwolters Nov 3, 2023
ce6ddfa
Last code improvements
Nov 3, 2023
3010e40
Updated ignore
Nov 3, 2023
0aad739
Setting version to 0.6.0
Nov 3, 2023
3fab053
Setting version to 0.6.1-SNAPSHOT
Nov 3, 2023
714a061
Updated organization
Nov 3, 2023
b93d580
Setting version to 0.6.0
Nov 3, 2023
882ae8b
Setting version to 0.6.1-SNAPSHOT
Nov 3, 2023
b3bf6b8
Put back old name
Nov 3, 2023
40d6e4c
Setting version to 0.6.0
Nov 3, 2023
b5ff99c
Setting version to 0.6.1-SNAPSHOT
Nov 3, 2023
167e6d3
Put back old name
Nov 3, 2023
94190e6
Setting version to 0.6.0
Nov 3, 2023
70344a6
Setting version to 0.6.1-SNAPSHOT
Nov 3, 2023
66e0465
Renamed packages and changed Akka to Pekko
Nov 3, 2023
a0499b1
Renamed packages and changed Akka to Pekko
Nov 3, 2023
b051278
Setting version to 0.6.1
Nov 3, 2023
32efa17
Setting version to 0.6.2-SNAPSHOT
Nov 3, 2023
136c3f8
Removing global executor
Nov 27, 2024
ceab5b7
Setting version to 0.6.2
Nov 27, 2024
5a717fa
Updating deps
Nov 27, 2024
fb324a1
Setting version to 0.6.2
Nov 27, 2024
d03c121
Setting version to 0.6.3-SNAPSHOT
Nov 27, 2024
6731877
More fixes for Execution Context
Nov 27, 2024
5d4af9b
Use actor-system from outside
Nov 27, 2024
f9b04fa
Setting version to 0.6.3
Nov 27, 2024
1e2e586
Setting version to 0.6.4-SNAPSHOT
Nov 27, 2024
2e83436
Update README.md
Nov 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ lib_managed/
src_managed/
project/boot/
project/plugins/project/
credentials.sbt

# Scala-IDE specific
.scala_dependencies
Expand All @@ -29,3 +30,4 @@ bin/
.idea_modules
projectFilesBackup

/.bsp/sbt.json
28 changes: 28 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
style = defaultWithAlign
//@formatter on
align {
tokens = [
{code = "=>", owner = "Case"}
{code = "extends", owner = "Defn.(Class|Trait|Object)"}
{code = "//", owner = ".*"}
{code = "{", owner = "Template"}
{code = "}", owner = "Template"}
{code = "%", owner = "Term.ApplyInfix"}
{code = "%%", owner = "Term.ApplyInfix"}
{code = "%%%", owner = "Term.ApplyInfix"}
{code = "=>", owner = "Case"}
{code = "<-", owner = "Enumerator.Generator"}
{code = "←", owner = "Enumerator.Generator"}
{code = "->", owner = "Term.ApplyInfix"}
{code = "→", owner = "Term.ApplyInfix"}
{code = "=", owner = "(Enumerator.Val|Defn.(Va(l|r)|Def|Type))"}
]
}
danglingParentheses = true
docstrings = JavaDoc
indentOperator = spray
maxColumn = 120
rewrite.rules = [RedundantBraces, RedundantParens, SortImports]
unindentTopLevelOperators = true
project.git = true
newlines.alwaysBeforeTopLevelStatements = true
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

23 changes: 2 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
[![Build Status](https://travis-ci.org/dlouwers/reactive-consul.svg?branch=master)](https://travis-ci.org/dlouwers/reactive-consul)
[![Maven Central](https://img.shields.io/maven-central/v/nl.stormlantern/reactive-consul_2.11.svg)](https://maven-badges.herokuapp.com/maven-central/nl.stormlantern/reactive-consul)
[![Maven Central](https://img.shields.io/maven-central/v/com.crobox.reactive-consul/client_2.13.svg)](https://maven-badges.herokuapp.com/maven-central/nl.stormlantern/reactive-consul)

# Reactive Consul
This project is a Consul client for Scala. It uses non-blocking I/O to communicate with a Consul cluster. You can use
the ServiceBroker to get out of the box support for automatic-clustering, loadbalancing and failover or you can use
the low-level ConsulHttpClient.


## Releases

### 0.3.0

* Multiple _connectionStrategies_ are now allowed per named service so that they can be distinguished between by tags

### 0.2.1

* Fixed the POM having an unwanted dependencies

### 0.2.0

* Supports Scala 2.12
* Uses akka-http instead of Spray, reducing the amount of dependencies (thanks [David Buschman](https://github.com/dbuschman7))
* Uses native JDK 8 base64, reducing the amount of dependencies (thanks [David Buschman](https://github.com/dbuschman7))
* Bootstrapping the library with SRV record is now an extra dependency (thanks [David Buschman](https://github.com/dbuschman7))

## Requirements

* Java 8
* Scala 2.11 or 2.12
* Scala 2.13

## Adding it to your project
Reactive Consul is available via [Maven Central](https://search.maven.org/), simply add it to your SBT build:
Expand Down
61 changes: 61 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
from http://www.scala-sbt.org/release/docs/Using-Sonatype.html

The credentials for your Sonatype OSSRH account need to be stored somewhere safe (e.g. NOT in the repository).
Common convention is a ~/.sbt/1.0/sonatype.sbt or (~/.sbt/.credentials) file with the following:

```
credentials += Credentials("Sonatype Nexus Repository Manager",
"oss.sonatype.org",
"<your username>",
"<your password>")
```

If not done already, generate a key and upload it to a keyserver.

```
$ gpg --gen-key
$ gpg --list-secret-keys
$ gpg --keyserver keyserver.ubuntu.com --send-keys 2BE.......E804D85663F
```

Release the client is done using the following three steps:

```
1. Release Code
2. Publish Artifacts
3. Releese Artifacts
```

## Release Code

To release and publish a version to oss.sonatype for both scala 2.12 and scala 2.13 run:

```
sbt release
```
It's likely that *after* pushing all artifacts to the online repository you'll see an error complaining that the
tag already exists. That's ok.

## Publish Artifacts

To only publish a certain version after f.e. the tags has been build, but your PGP was not correctly unlocked you can
run

```
sbt publishSigned
```

If you want to publish only a single SCALA version, use `sbt ++2.11.12 publishSigned`

## Release Artifacts

To close and release the staging repository on Sonatype you can either go to the web interface or use

```
sbt sonatypeRelease
```

If something goes wrong and you want to cleanup/rollback, use `sbt sonatypeDropAll`

You can verify if all has been published correctly by visiting the following url:<br>
https://oss.sonatype.org/#nexus-search;quick~crobox
213 changes: 64 additions & 149 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,160 +1,75 @@
import Dependencies._
import sbt.Keys._
import com.typesafe.sbt.SbtScalariform
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
releaseCrossBuild := true

import scalariform.formatter.preferences._
sonatypeProfileName := "com.crobox"

// Common variables
lazy val commonSettings = Seq(
scalaVersion := "2.11.8",
crossScalaVersions := Seq("2.11.8", "2.12.2"),
organization := "nl.stormlantern",
version := "0.4.0-SNAPSHOT",
resolvers ++= Dependencies.resolutionRepos,
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")
)

lazy val reactiveConsul = (project in file("."))
.settings( commonSettings: _* )
.settings( publishSettings: _* )
.aggregate(client, dnsHelper, dockerTestkit/*, example*/)


lazy val dnsHelper = (project in file("dns-helper"))
.settings( commonSettings: _* )
.settings( publishSettings: _* )
.settings(
name := "reactive-consul-dns",
publishArtifact in Compile := true,
publishArtifact in makePom := true,
publishArtifact in Test := false,
publishArtifact in IntegrationTest := false,
fork := true,
libraryDependencies ++= Seq(
spotifyDns
),
ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(DoubleIndentClassDeclaration, true)
.setPreference(DanglingCloseParenthesis, Preserve)
.setPreference(RewriteArrowSymbols, true)
)
ThisBuild / versionScheme := Some("early-semver")

lazy val client = (project in file("client"))
.settings( commonSettings: _* )
.settings( publishSettings: _* )
lazy val root = (project in file("."))
.settings(
name := "reactive-consul",
publishArtifact in Compile := true,
publishArtifact in makePom := true,
publishArtifact in Test := false,
publishArtifact in IntegrationTest := false,
fork := true,
libraryDependencies ++= Seq(
akkaHttp,
sprayJson,
akkaActor,
slf4j,
akkaSlf4j,
scalaTest % "it,test",
scalaMock % "test",
logback % "it,test",
akkaTestKit % "it,test",
spotifyDocker % "it,test"
publish := {},
publishArtifact := false,
inThisBuild(
List(
organization := "com.crobox.reactive-consul",
scalaVersion := "2.13.15",
crossScalaVersions := List("2.13.15"),
javacOptions ++= Seq("-g", "-Xlint:unchecked", "-Xlint:deprecation", "-source", "11", "-target", "11"),
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature", "-language:_", "-encoding", "UTF-8"),
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
pomExtra := {
<url>https://github.com/crobox/reactive-consul</url>
<licenses>
<license>
<name>MIT</name>
<url>https://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:crobox/reactive-consul.git</url>
<connection>scm:[email protected]:crobox/reactive-consul.git</connection>
</scm>
<developers>
<developer>
<id>crobox</id>
<name>crobox</name>
<url>https://github.com/crobox</url>
</developer>
<developer>
<id>dlouwers</id>
<name>Dirk Louwers</name>
<url>http://github.com/dlouwers</url>
</developer>
</developers>
}
)
),
ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(DoubleIndentClassDeclaration, true)
.setPreference(DanglingCloseParenthesis, Preserve)
.setPreference(RewriteArrowSymbols, true)
name := "reactive-consul"
)
.configs( IntegrationTest )
.settings( Defaults.itSettings : _* )
.settings( SbtScalariform.scalariformSettingsWithIt : _* )
.dependsOn(dockerTestkit % "it-internal")
.aggregate(client)

lazy val dockerTestkit = (project in file("docker-testkit"))
.settings( commonSettings: _* )
lazy val client: Project = (project in file("client"))
.configs(Config.CustomIntegrationTest)
.settings(Config.testSettings: _*)
.settings(
name := "client",
sbtrelease.ReleasePlugin.autoImport.releasePublishArtifactsAction := PgpKeys.publishSigned.value,
libraryDependencies ++= Seq(
slf4j,
scalaTest,
spotifyDocker
"ch.qos.logback" % "logback-classic" % "1.4.7",
"io.spray" %% "spray-json" % "1.3.6",
"org.apache.pekko" %% "pekko-actor" % Dependencies.PekkoVersion,
"org.apache.pekko" %% "pekko-slf4j" % Dependencies.PekkoVersion,
"org.apache.pekko" %% "pekko-stream" % Dependencies.PekkoVersion,
"org.apache.pekko" %% "pekko-http" % Dependencies.PekkoHttpVersion,
// test dependencies
"org.apache.pekko" %% "pekko-testkit" % Dependencies.PekkoVersion % Test,
"org.scalatest" %% "scalatest" % "3.2.15" % Test,
"org.scalamock" %% "scalamock" % "5.2.0" % Test
)
)
.configs( IntegrationTest )
.settings( Defaults.itSettings : _* )
.settings( SbtScalariform.scalariformSettingsWithIt : _* )
.settings( publishSettings: _* )


//lazy val example = (project in file("example"))
// .aggregate(client)
// .dependsOn(client, dnsHelper)
// .settings( commonSettings: _* )
// .settings(
// crossScalaVersions := Seq()
// )
// .settings(
// libraryDependencies ++= Seq(
// sprayClient,
// sprayRouting,
// sprayJson,
// slf4j,
// logback
// )
// )
// .settings(
// fork := true,
// libraryDependencies ++= Seq(
// akkaActor,
// sprayClient,
// sprayJson
// )
// )
// .settings( publishSettings: _* )
// .enablePlugins(JavaAppPackaging)
// .settings(
// packageName in Docker := "reactive-consul-example",
// maintainer in Docker := "Dirk Louwers <[email protected]>",
// dockerExposedPorts in Docker := Seq(8080),
// dockerExposedVolumes in Docker := Seq("/opt/docker/logs")
// )

lazy val publishSettings = Seq(
publishArtifact := false,
publishMavenStyle := true,
pomIncludeRepository := { _ => false },
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
pomExtra := (
<url>http://github.com/dlouwers/reactive-consul</url>
<licenses>
<license>
<name>MIT</name>
<url>https://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>[email protected]:dlouwers/reactive-consul.git</url>
<connection>scm:[email protected]:dlouwers/reactive-consul.git</connection>
</scm>
<developers>
<developer>
<id>dlouwers</id>
<name>Dirk Louwers</name>
<url>http://github.com/dlouwers</url>
</developer>
</developers>
)
)

Revolver.settings.settings
6 changes: 3 additions & 3 deletions client/src/it/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
pekko {
loggers = ["org.apache.pekko.event.slf4j.Slf4jLogger"]
loglevel = "INFO"
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
logging-filter = "org.apache.pekko.event.slf4j.Slf4jLoggingFilter"
log-dead-letters-during-shutdown = off
}
Loading