Skip to content

Commit fdbf9d1

Browse files
committed
Migrating from Akka to Pekko
1 parent f083431 commit fdbf9d1

File tree

60 files changed

+237
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+237
-236
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,8 @@ ElasticMQ exposes `Queues` MBean. It contains three operations:
621621

622622
# Technology
623623

624-
* Core: [Scala](http://scala-lang.org) and [Akka](http://akka.io/).
625-
* Rest server: [Akka HTTP](http://doc.akka.io/docs/akka-http/current/), a high-performance,
624+
* Core: [Scala](http://scala-lang.org) and [Pekko](https://pekko.apache.org/).
625+
* Rest server: [Pekko HTTP](https://pekko.apache.org/docs/pekko-http/current/), a high-performance,
626626
asynchronous, REST/HTTP toolkit.
627627
* Testing the SQS interface: [Amazon Java SDK](http://aws.amazon.com/sdkforjava/);
628628
see the `rest-sqs-testing-amazon-java-sdk` module for the testsuite.

build.sbt

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ val awaitility = "org.awaitility" % "awaitility-scala" % "4.2.0"
3838

3939
val amazonJavaSdkSqs = "com.amazonaws" % "aws-java-sdk-sqs" % "1.12.472" exclude ("commons-logging", "commons-logging")
4040

41-
val akkaVersion = "2.6.20"
42-
val akkaHttpVersion = "10.2.10"
43-
val akka2Actor = "com.typesafe.akka" %% "akka-actor" % akkaVersion
44-
val akka2Slf4j = "com.typesafe.akka" %% "akka-slf4j" % akkaVersion
45-
val akka2Streams = "com.typesafe.akka" %% "akka-stream" % akkaVersion
46-
val akka2Testkit = "com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test"
47-
val akka2Http = "com.typesafe.akka" %% "akka-http" % akkaHttpVersion
41+
val pekkoVersion = "1.0.1"
42+
val pekkoHttpVersion = "1.0.0"
43+
val pekkoActor = "org.apache.pekko" %% "pekko-actor" % pekkoVersion
44+
val pekkoSlf4j = "org.apache.pekko" %% "pekko-slf4j" % pekkoVersion
45+
val pekkoStreams = "org.apache.pekko" %% "pekko-stream" % pekkoVersion
46+
val pekkoTestkit = "org.apache.pekko" %% "pekko-testkit" % pekkoVersion % "test"
47+
val pekkoHttp = "org.apache.pekko" %% "pekko-http" % pekkoHttpVersion
4848
val sprayJson = "io.spray" %% "spray-json" % "1.3.6"
49-
val akkaHttpSprayJson = "com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion
50-
val akka2HttpTestkit = "com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % "test"
49+
val pekkoHttpSprayJson = "org.apache.pekko" %% "pekko-http-spray-json" % pekkoHttpVersion
50+
val pekkoHttpTestkit = "org.apache.pekko" %% "pekko-http-testkit" % pekkoHttpVersion % "test"
5151

5252
val awsSpringMessagingVersion = "2.2.6.RELEASE"
5353
val springVersion = "5.3.30"
@@ -61,10 +61,10 @@ val h2 = "com.h2database" % "h2" % "2.2.224"
6161

6262
val common = Seq(scalalogging)
6363

64-
val akka25Overrides =
65-
Seq( // override the 2.4.x transitive dependency from Akka HTTP
66-
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
67-
"com.typesafe.akka" %% "akka-stream-testkit" % akkaVersion
64+
val pekko100verrides =
65+
Seq( // override transitive dependency from Pekko HTTP
66+
"org.apache.pekko" %% "pekko-stream" % pekkoVersion,
67+
"org.apache.pekko" %% "pekko-stream-testkit" % pekkoVersion
6868
)
6969

7070
val buildSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
@@ -75,7 +75,7 @@ val buildSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
7575
scalaVersion := resolvedScalaVersion,
7676
scalacOptions ++= Seq("-Xasync", "-target:jvm-1.8"),
7777
libraryDependencies += scalaXml,
78-
dependencyOverrides := akka25Overrides,
78+
dependencyOverrides := pekko100verrides,
7979
parallelExecution := false,
8080
sonatypeProfileName := "org.elasticmq",
8181
// workaround for: https://github.com/sbt/sbt/issues/692
@@ -109,7 +109,7 @@ lazy val core: Project = (project in file("core"))
109109
.settings(
110110
Seq(
111111
name := "elasticmq-core",
112-
libraryDependencies ++= Seq(akka2Actor, akka2Testkit) ++ common,
112+
libraryDependencies ++= Seq(pekkoActor, pekkoTestkit) ++ common,
113113
coverageMinimumStmtTotal := 94
114114
)
115115
)
@@ -126,10 +126,10 @@ lazy val persistenceCore: Project = (project in file("persistence/persistence-co
126126
Seq(
127127
name := "elasticmq-persistence-core",
128128
libraryDependencies ++= Seq(
129-
akka2Actor,
130-
akka2Slf4j,
129+
pekkoActor,
130+
pekkoSlf4j,
131131
config,
132-
akka2Testkit,
132+
pekkoTestkit,
133133
scalaAsync
134134
) ++ common
135135
)
@@ -171,14 +171,14 @@ lazy val restSqs: Project = (project in file("rest/rest-sqs"))
171171
Seq(
172172
name := "elasticmq-rest-sqs",
173173
libraryDependencies ++= Seq(
174-
akka2Actor,
175-
akka2Slf4j,
176-
akka2Http,
177-
akka2Streams,
174+
pekkoActor,
175+
pekkoSlf4j,
176+
pekkoHttp,
177+
pekkoStreams,
178178
sprayJson,
179-
akkaHttpSprayJson,
180-
akka2Testkit,
181-
akka2HttpTestkit,
179+
pekkoHttpSprayJson,
180+
pekkoTestkit,
181+
pekkoHttpTestkit,
182182
scalaAsync
183183
) ++ common
184184
)

core/src/main/scala/org/elasticmq/actor/QueueManagerActor.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.elasticmq.actor
22

3-
import akka.actor.{ActorRef, Props}
3+
import org.apache.pekko.actor.{ActorRef, Props}
44
import org.elasticmq._
55
import org.elasticmq.actor.queue.{QueueActor, QueueEvent}
66
import org.elasticmq.actor.reply._

core/src/main/scala/org/elasticmq/actor/queue/QueueActor.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.elasticmq.actor.queue
22

3-
import akka.actor.ActorRef
3+
import org.apache.pekko.actor.ActorRef
44
import org.elasticmq.QueueData
55
import org.elasticmq.actor.reply.ReplyingActor
66
import org.elasticmq.msg._

core/src/main/scala/org/elasticmq/actor/queue/QueueActorMessageOps.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.elasticmq.actor.queue
22

3-
import akka.actor.Timers
3+
import org.apache.pekko.actor.Timers
44
import org.elasticmq.actor.queue.operations._
55
import org.elasticmq.actor.reply._
66
import org.elasticmq.msg._
@@ -19,7 +19,7 @@ trait QueueActorMessageOps
1919
this: QueueActorStorage =>
2020

2121
def nowProvider: NowProvider
22-
def context: akka.actor.ActorContext
22+
def context: org.apache.pekko.actor.ActorContext
2323

2424
timers.startTimerWithFixedDelay(s"Timer: ${queueData.name}", DeduplicationIdsCleanup, 1.second)
2525

core/src/main/scala/org/elasticmq/actor/queue/QueueActorStorage.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.elasticmq.actor.queue
22

3-
import akka.actor.{ActorContext, ActorRef}
4-
import akka.util.Timeout
3+
import org.apache.pekko.actor.{ActorContext, ActorRef}
4+
import org.apache.pekko.util.Timeout
55
import org.elasticmq.actor.reply._
66
import org.elasticmq.util.{Logging, NowProvider}
77
import org.elasticmq.{FifoDeduplicationIdsHistory, QueueData}

core/src/main/scala/org/elasticmq/actor/queue/QueueActorWaitForMessagesOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.elasticmq.actor.queue
22

3-
import akka.actor.{ActorRef, Cancellable}
3+
import org.apache.pekko.actor.{ActorRef, Cancellable}
44
import org.elasticmq.actor.reply._
55
import org.elasticmq.msg.{QueueMessageMsg, ReceiveMessages, SendMessage, UpdateVisibilityTimeout}
66

core/src/main/scala/org/elasticmq/actor/queue/QueueEventListener.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.elasticmq.actor.queue
22

3-
import akka.actor.ActorRef
3+
import org.apache.pekko.actor.ActorRef
44
import org.elasticmq.actor.reply.Replyable
55
import org.elasticmq.{ElasticMQError, QueueData}
66

core/src/main/scala/org/elasticmq/actor/queue/operations/SendMessageOp.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.elasticmq.actor.queue.operations
22

3-
import akka.actor.{ActorContext, ActorRef}
3+
import org.apache.pekko.actor.{ActorContext, ActorRef}
44
import org.elasticmq.actor.queue.{InternalMessage, QueueActorStorage, QueueEvent}
55
import org.elasticmq.msg.SendMessage
66
import org.elasticmq.util.Logging

core/src/main/scala/org/elasticmq/actor/reply/ReplySupport.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
package org.elasticmq.actor.reply
22

3-
import akka.actor.ActorRef
4-
import akka.util.Timeout
3+
import org.apache.pekko.actor.ActorRef
4+
import org.apache.pekko.util.Timeout
5+
import org.apache.pekko.pattern
56
import scala.concurrent.Future
67
import scala.reflect.ClassTag
78

89
trait ReplySupport {
910
implicit class ReplyActorRef(actorRef: ActorRef) {
1011
def ?[T](message: Replyable[T])(implicit timeout: Timeout, tag: ClassTag[T]): Future[T] = {
11-
akka.pattern.ask(actorRef, message).mapTo[T]
12+
pattern.ask(actorRef, message).mapTo[T]
1213
}
1314
}
1415

0 commit comments

Comments
 (0)