From c3077151d6488e691d00caab77a16de2e60930ed Mon Sep 17 00:00:00 2001 From: oat9002 Date: Sat, 8 Nov 2025 00:09:38 +0700 Subject: [PATCH 1/4] Migrate dependencies from Akka to Pekko --- project/Dependencies.scala | 23 +++++++++---------- .../services/scheduler/QuartzService.scala | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 7099f73..5a5dc3d 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -1,11 +1,11 @@ import sbt.* object Dependencies { - val akka = "2.6.20" - val akkaHttp = "10.2.10" - val akkaHttpCircie = "1.39.2" + val pekko = "1.1.5" + val pekkoHttp = "1.3.0" + val pekkoHttpCircie = "3.6.0" val typesafeConfig = "1.4.3" - val akkaQuartz = "1.9.3-akka-2.6.x" + val pekkoQuartz = "1.3.0-pekko-1.1.x" val macWire = "2.5.8" val scalaLogging = "3.9.5" val slf4j = "2.0.13" @@ -17,15 +17,14 @@ object Dependencies { val retry = "0.3.6" lazy val dependencies: Seq[ModuleID] = Seq( - "com.typesafe.akka" %% "akka-actor-typed" % akka cross CrossVersion.for3Use2_13 excludeAll + "org.apache.pekko" %% "pekko-actor-typed" % pekko cross CrossVersion.for3Use2_13 excludeAll (ExclusionRule(organization = "org.slf4j"), ExclusionRule("com.typesafe", "config")), - "com.typesafe.akka" %% "akka-stream" % akka cross CrossVersion.for3Use2_13, - "com.typesafe.akka" %% "akka-http" % akkaHttp cross CrossVersion.for3Use2_13, - "de.heikoseeberger" %% "akka-http-circe" % akkaHttpCircie cross CrossVersion.for3Use2_13 excludeAll (ExclusionRule( + "org.apache.pekko" %% "pekko-stream" % pekko cross CrossVersion.for3Use2_13, + "org.apache.pekko" %% "pekko-http" % pekkoHttp cross CrossVersion.for3Use2_13, + "com.github.pjfanning" %% "pekko-http-circe" % pekkoHttpCircie cross CrossVersion.for3Use2_13 excludeAll ExclusionRule( organization = "io.circe" ), - ExclusionRule("com.typesafe.akka", "akka-http")), - "com.enragedginger" % "akka-quartz-scheduler" % akkaQuartz cross CrossVersion.for3Use2_13 excludeAll + "io.github.samueleresca" % "pekko-quartz-scheduler" % pekkoQuartz cross CrossVersion.for3Use2_13 excludeAll ExclusionRule(organization = "org.slf4j"), "com.typesafe" % "config" % typesafeConfig, "io.circe" %% "circe-core" % circe, @@ -36,7 +35,7 @@ object Dependencies { ExclusionRule(organization = "org.slf4j"), "ch.qos.logback" % "logback-classic" % logback, "com.softwaremill.sttp.client3" %% "core" % sttp cross CrossVersion.for3Use2_13, - "com.softwaremill.sttp.client3" % "akka-http-backend" % sttp cross CrossVersion.for3Use2_13, + "com.softwaremill.sttp.client3" % "pekko-http-backend" % sttp cross CrossVersion.for3Use2_13, "com.softwaremill.sttp.client3" %% "circe" % sttp cross CrossVersion.for3Use2_13 excludeAll ExclusionRule(organization = "io.circe"), "org.web3j" % "core" % web3j excludeAll @@ -47,7 +46,7 @@ object Dependencies { lazy val testDependencies: Seq[ModuleID] = Seq( "org.scalatest" %% "scalatest" % scalaTest % "test", "org.scalatest" %% "scalatest-shouldmatchers" % scalaTest % "test", - "com.typesafe.akka" %% "akka-actor-testkit-typed" % akka % "test" cross CrossVersion.for3Use2_13 + "org.apache.pekko" %% "pekko-actor-testkit-typed" % pekko % "test" cross CrossVersion.for3Use2_13 ) lazy val allDependencies: Seq[ModuleID] = dependencies ++ testDependencies diff --git a/src/main/scala/services/scheduler/QuartzService.scala b/src/main/scala/services/scheduler/QuartzService.scala index f8a7886..a2c5217 100644 --- a/src/main/scala/services/scheduler/QuartzService.scala +++ b/src/main/scala/services/scheduler/QuartzService.scala @@ -1,7 +1,7 @@ package services.scheduler import akka.actor.typed.{ActorRef, ActorSystem} -import com.typesafe.akka.extension.quartz.QuartzSchedulerTypedExtension +import org.apache.pekko.extension.quartz.QuartzSchedulerTypedExtension import com.typesafe.scalalogging.LazyLogging import commons.LocalLogger import services.scheduler.QuartzService From 5a3c52b1954cba524fc6a5d704d294694ff4c7bd Mon Sep 17 00:00:00 2001 From: oat9002 Date: Sun, 9 Nov 2025 17:52:55 +0700 Subject: [PATCH 2/4] :construction: --- src/main/scala/Boot.scala | 14 +++++++------- src/main/scala/actors/Scheduler.scala | 4 ++-- src/main/scala/commons/HttpClient.scala | 10 +++++----- src/main/scala/commons/Util.scala | 4 ++-- .../scala/controllers/HealthCheckController.scala | 10 +++++----- src/main/scala/controllers/NotifyController.scala | 10 +++++----- src/main/scala/di/DependencySetup.scala | 2 +- src/main/scala/processors/BaseProcessor.scala | 2 +- src/main/scala/processors/ExecuteProcessor.scala | 2 +- .../scala/processors/HealthCheckProcessor.scala | 2 +- src/main/scala/processors/NotifyProcessor.scala | 2 +- .../scala/services/crypto/BinanceService.scala | 2 +- .../scala/services/crypto/BitcoinService.scala | 2 +- .../scala/services/crypto/EtherScanService.scala | 2 +- src/main/scala/services/crypto/SatangService.scala | 2 +- src/main/scala/services/crypto/TerraService.scala | 2 +- .../services/crypto/contracts/PancakeService.scala | 2 +- .../services/healthcheck/MackerelService.scala | 2 +- .../services/notification/TelegramService.scala | 2 +- .../scala/services/scheduler/QuartzService.scala | 2 +- src/main/scala/services/user/UserService.scala | 2 +- .../validators/controllers/ApiKeyValidator.scala | 6 +++--- 22 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/main/scala/Boot.scala b/src/main/scala/Boot.scala index 4a8ce5e..23f5864 100644 --- a/src/main/scala/Boot.scala +++ b/src/main/scala/Boot.scala @@ -1,13 +1,13 @@ import actors.{Command, Scheduler} -import akka.actor.typed.ActorSystem -import akka.actor.typed.scaladsl.Behaviors -import akka.http.scaladsl.Http -import akka.http.scaladsl.model.* -import akka.http.scaladsl.server.Directives.* -import akka.http.scaladsl.server.Route +import com.github.pjfanning.pekkohttpcirce.FailFastCirceSupport +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.scaladsl.Behaviors +import org.apache.pekko.http.scaladsl.Http +import org.apache.pekko.http.scaladsl.model.* +import org.apache.pekko.http.scaladsl.server.Directives.* +import org.apache.pekko.http.scaladsl.server.Route import commons.{Configuration, LocalLogger} import controllers.{HealthCheckController, NotifyController} -import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport import di.DependencySetup import processors.{ExecuteProcessor, ExecutorProcessorImpl, NotifyProcessor} import services.scheduler.{QuartzService, QuartzServiceImpl} diff --git a/src/main/scala/actors/Scheduler.scala b/src/main/scala/actors/Scheduler.scala index dfe005b..de624fc 100644 --- a/src/main/scala/actors/Scheduler.scala +++ b/src/main/scala/actors/Scheduler.scala @@ -1,7 +1,7 @@ package actors -import akka.actor.typed.Behavior -import akka.actor.typed.scaladsl.{AbstractBehavior, ActorContext, Behaviors} +import org.apache.pekko.actor.typed.Behavior +import org.apache.pekko.actor.typed.scaladsl.{AbstractBehavior, ActorContext, Behaviors} import commons.LocalLogger import processors.{HealthCheckProcessor, NotifyProcessor} diff --git a/src/main/scala/commons/HttpClient.scala b/src/main/scala/commons/HttpClient.scala index d44f504..7fb2930 100644 --- a/src/main/scala/commons/HttpClient.scala +++ b/src/main/scala/commons/HttpClient.scala @@ -1,13 +1,13 @@ package commons -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import io.circe.* import retry.Success.* import sttp.* -import sttp.capabilities.akka.AkkaStreams +import sttp.capabilities.pekko.PekkoStreams import sttp.client3.* -import sttp.client3.akkahttp.AkkaHttpBackend import sttp.client3.circe.asJson +import sttp.client3.pekkohttp.PekkoHttpBackend import sttp.model.StatusCode import scala.concurrent.duration.DurationInt @@ -38,8 +38,8 @@ class HttpClientImpl(using system: ActorSystem[Nothing], ec: ExecutionContext ) extends HttpClient { - val backend: SttpBackend[Future, AkkaStreams with capabilities.WebSockets] = - AkkaHttpBackend.usingActorSystem(system.classicSystem) + val backend: SttpBackend[Future, PekkoStreams with capabilities.WebSockets] = + PekkoHttpBackend.usingActorSystem(system.classicSystem) override def get[Res](url: String, header: Map[String, String])(using decoder: Decoder[Res] ): Future[Either[String, Res]] = { diff --git a/src/main/scala/commons/Util.scala b/src/main/scala/commons/Util.scala index eff4211..1b33b76 100644 --- a/src/main/scala/commons/Util.scala +++ b/src/main/scala/commons/Util.scala @@ -1,7 +1,7 @@ package commons -import akka.actor.typed.ActorSystem -import akka.http.scaladsl.model.ResponseEntity +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.http.scaladsl.model.ResponseEntity import commons.Constant.EncryptionAlgorithm import java.nio.charset.StandardCharsets diff --git a/src/main/scala/controllers/HealthCheckController.scala b/src/main/scala/controllers/HealthCheckController.scala index 714cae5..94dfb4b 100644 --- a/src/main/scala/controllers/HealthCheckController.scala +++ b/src/main/scala/controllers/HealthCheckController.scala @@ -1,10 +1,10 @@ package controllers -import akka.actor.typed.ActorSystem -import akka.http.scaladsl.model.{ContentTypes, HttpEntity} -import akka.http.scaladsl.server.Directives.{complete, get, path} -import akka.http.scaladsl.server.Route -import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport +import com.github.pjfanning.pekkohttpcirce.FailFastCirceSupport +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.http.scaladsl.model.{ContentTypes, HttpEntity} +import org.apache.pekko.http.scaladsl.server.Directives.{complete, get, path} +import org.apache.pekko.http.scaladsl.server.Route import models.mackerel.* import services.healthcheck.MackerelService diff --git a/src/main/scala/controllers/NotifyController.scala b/src/main/scala/controllers/NotifyController.scala index b44f3d7..47a6e80 100644 --- a/src/main/scala/controllers/NotifyController.scala +++ b/src/main/scala/controllers/NotifyController.scala @@ -1,11 +1,11 @@ package controllers -import akka.actor.typed.ActorSystem -import akka.http.scaladsl.model.StatusCodes.{InternalServerError, OK} -import akka.http.scaladsl.server.Directives.{complete, get, headerValueByName, onComplete, path} -import akka.http.scaladsl.server.Route +import com.github.pjfanning.pekkohttpcirce.FailFastCirceSupport +import org.apache.pekko.actor.typed.ActorSystem +import org.apache.pekko.http.scaladsl.model.StatusCodes.{InternalServerError, OK} +import org.apache.pekko.http.scaladsl.server.Directives.{complete, get, headerValueByName, onComplete, path} +import org.apache.pekko.http.scaladsl.server.Route import commons.Configuration -import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport import models.controller.NotifyResponse import processors.NotifyProcessor import validators.controllers.ApiKeyValidator diff --git a/src/main/scala/di/DependencySetup.scala b/src/main/scala/di/DependencySetup.scala index 36a33a7..ec3c767 100644 --- a/src/main/scala/di/DependencySetup.scala +++ b/src/main/scala/di/DependencySetup.scala @@ -1,6 +1,6 @@ package di -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import commons.* import helpers.{TerraHelper, TerraHelperImpl} import processors.{ diff --git a/src/main/scala/processors/BaseProcessor.scala b/src/main/scala/processors/BaseProcessor.scala index dd3eec2..bfd74d4 100644 --- a/src/main/scala/processors/BaseProcessor.scala +++ b/src/main/scala/processors/BaseProcessor.scala @@ -1,7 +1,7 @@ package processors import actors.Command -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import scala.concurrent.{ExecutionContext, Future} diff --git a/src/main/scala/processors/ExecuteProcessor.scala b/src/main/scala/processors/ExecuteProcessor.scala index 35aa311..e90ad3f 100644 --- a/src/main/scala/processors/ExecuteProcessor.scala +++ b/src/main/scala/processors/ExecuteProcessor.scala @@ -1,7 +1,7 @@ package processors import actors.* -import akka.actor.typed.* +import org.apache.pekko.actor.typed.* import commons.{Configuration, LocalLogger} import services.* import services.scheduler.{QuartzService, SchedulerName} diff --git a/src/main/scala/processors/HealthCheckProcessor.scala b/src/main/scala/processors/HealthCheckProcessor.scala index 05d2ad0..103714e 100644 --- a/src/main/scala/processors/HealthCheckProcessor.scala +++ b/src/main/scala/processors/HealthCheckProcessor.scala @@ -1,6 +1,6 @@ package processors -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import commons.{Configuration, HttpClient} import models.mackerel.MackerelRequest import services.healthcheck.MackerelService diff --git a/src/main/scala/processors/NotifyProcessor.scala b/src/main/scala/processors/NotifyProcessor.scala index 29e966f..2d135a7 100644 --- a/src/main/scala/processors/NotifyProcessor.scala +++ b/src/main/scala/processors/NotifyProcessor.scala @@ -1,6 +1,6 @@ package processors -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import commons.CommonUtil.getFormattedNowDate import commons.{Configuration, Logger} import services.notification.NotificationService diff --git a/src/main/scala/services/crypto/BinanceService.scala b/src/main/scala/services/crypto/BinanceService.scala index a5e24e2..aa89f90 100644 --- a/src/main/scala/services/crypto/BinanceService.scala +++ b/src/main/scala/services/crypto/BinanceService.scala @@ -1,6 +1,6 @@ package services.crypto -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import commons.Constant.EncryptionAlgorithm import commons.* import models.CryptoBalance diff --git a/src/main/scala/services/crypto/BitcoinService.scala b/src/main/scala/services/crypto/BitcoinService.scala index 72e750b..ba07556 100644 --- a/src/main/scala/services/crypto/BitcoinService.scala +++ b/src/main/scala/services/crypto/BitcoinService.scala @@ -1,6 +1,6 @@ package services.crypto -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import commons.{Configuration, Constant, HttpClient, Logger} import helpers.BitcoinHelper import models.bitcoin.Utxo diff --git a/src/main/scala/services/crypto/EtherScanService.scala b/src/main/scala/services/crypto/EtherScanService.scala index 9cddf46..b2b9cf4 100644 --- a/src/main/scala/services/crypto/EtherScanService.scala +++ b/src/main/scala/services/crypto/EtherScanService.scala @@ -1,6 +1,6 @@ package services.crypto -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import commons.{Configuration, Constant, HttpClient, Logger} import models.etherScan.EtherScanResponse diff --git a/src/main/scala/services/crypto/SatangService.scala b/src/main/scala/services/crypto/SatangService.scala index 2c1015a..a9f8fd7 100644 --- a/src/main/scala/services/crypto/SatangService.scala +++ b/src/main/scala/services/crypto/SatangService.scala @@ -1,6 +1,6 @@ package services.crypto -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import com.typesafe.scalalogging.LazyLogging import commons.Constant.EncryptionAlgorithm import commons.* diff --git a/src/main/scala/services/crypto/TerraService.scala b/src/main/scala/services/crypto/TerraService.scala index 7579be6..0685d75 100644 --- a/src/main/scala/services/crypto/TerraService.scala +++ b/src/main/scala/services/crypto/TerraService.scala @@ -1,6 +1,6 @@ package services.crypto -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import com.typesafe.scalalogging.LazyLogging import commons.* import helpers.TerraHelper diff --git a/src/main/scala/services/crypto/contracts/PancakeService.scala b/src/main/scala/services/crypto/contracts/PancakeService.scala index 426b421..7629824 100644 --- a/src/main/scala/services/crypto/contracts/PancakeService.scala +++ b/src/main/scala/services/crypto/contracts/PancakeService.scala @@ -1,6 +1,6 @@ package services.crypto.contracts -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import commons.{Configuration, Constant, Logger} import contracts.pancake.{CakePool, VeCakePool} import org.web3j.crypto.Credentials diff --git a/src/main/scala/services/healthcheck/MackerelService.scala b/src/main/scala/services/healthcheck/MackerelService.scala index 6a56fd9..50eb366 100644 --- a/src/main/scala/services/healthcheck/MackerelService.scala +++ b/src/main/scala/services/healthcheck/MackerelService.scala @@ -1,6 +1,6 @@ package services.healthcheck -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import com.typesafe.scalalogging.LazyLogging import commons.{Configuration, Constant, HttpClient, Logger} import io.circe.syntax.* diff --git a/src/main/scala/services/notification/TelegramService.scala b/src/main/scala/services/notification/TelegramService.scala index 63ae0ea..22bebc1 100644 --- a/src/main/scala/services/notification/TelegramService.scala +++ b/src/main/scala/services/notification/TelegramService.scala @@ -1,6 +1,6 @@ package services.notification -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import com.typesafe.scalalogging.LazyLogging import commons.Constant.MessageProvider.Telegram import commons.{Configuration, Constant, HttpClient, LocalLogger} diff --git a/src/main/scala/services/scheduler/QuartzService.scala b/src/main/scala/services/scheduler/QuartzService.scala index a2c5217..d1f4c92 100644 --- a/src/main/scala/services/scheduler/QuartzService.scala +++ b/src/main/scala/services/scheduler/QuartzService.scala @@ -1,6 +1,6 @@ package services.scheduler -import akka.actor.typed.{ActorRef, ActorSystem} +import org.apache.pekko.actor.typed.{ActorRef, ActorSystem} import org.apache.pekko.extension.quartz.QuartzSchedulerTypedExtension import com.typesafe.scalalogging.LazyLogging import commons.LocalLogger diff --git a/src/main/scala/services/user/UserService.scala b/src/main/scala/services/user/UserService.scala index 724b6aa..05925d9 100644 --- a/src/main/scala/services/user/UserService.scala +++ b/src/main/scala/services/user/UserService.scala @@ -1,6 +1,6 @@ package services.user -import akka.actor.typed.ActorSystem +import org.apache.pekko.actor.typed.ActorSystem import commons.Constant import commons.Constant.MessageProvider import models.CryptoBalance diff --git a/src/main/scala/validators/controllers/ApiKeyValidator.scala b/src/main/scala/validators/controllers/ApiKeyValidator.scala index 758e1ee..094fb3f 100644 --- a/src/main/scala/validators/controllers/ApiKeyValidator.scala +++ b/src/main/scala/validators/controllers/ApiKeyValidator.scala @@ -1,8 +1,8 @@ package validators.controllers -import akka.http.scaladsl.model.StatusCodes -import akka.http.scaladsl.server.Directives.headerValueByName -import akka.http.scaladsl.server.{ +import org.apache.pekko.http.scaladsl.model.StatusCodes +import org.apache.pekko.http.scaladsl.server.Directives.headerValueByName +import org.apache.pekko.http.scaladsl.server.{ AuthenticationFailedRejection, Directive0, Directives, From 739182610918b00b0906ca8f9a5774ebad9cd3db Mon Sep 17 00:00:00 2001 From: oat9002 Date: Sun, 9 Nov 2025 18:24:08 +0700 Subject: [PATCH 3/4] :construction: --- project/Dependencies.scala | 14 +++++++------- src/main/scala/commons/HttpClient.scala | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 5a5dc3d..212e52e 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -4,16 +4,16 @@ object Dependencies { val pekko = "1.1.5" val pekkoHttp = "1.3.0" val pekkoHttpCircie = "3.6.0" - val typesafeConfig = "1.4.3" + val typesafeConfig = "1.4.5" val pekkoQuartz = "1.3.0-pekko-1.1.x" val macWire = "2.5.8" - val scalaLogging = "3.9.5" - val slf4j = "2.0.13" - val logback = "1.5.6" - val scalaTest = "3.2.15" - val sttp = "3.9.7" + val scalaLogging = "3.9.6" + val slf4j = "2.0.17" + val logback = "1.5.20" + val scalaTest = "3.2.19" + val sttp = "3.11.0" val web3j = "4.10.3" - val circe = "0.14.9" + val circe = "0.14.15" val retry = "0.3.6" lazy val dependencies: Seq[ModuleID] = Seq( diff --git a/src/main/scala/commons/HttpClient.scala b/src/main/scala/commons/HttpClient.scala index 7fb2930..2cfd41e 100644 --- a/src/main/scala/commons/HttpClient.scala +++ b/src/main/scala/commons/HttpClient.scala @@ -2,7 +2,6 @@ package commons import org.apache.pekko.actor.typed.ActorSystem import io.circe.* -import retry.Success.* import sttp.* import sttp.capabilities.pekko.PekkoStreams import sttp.client3.* From 827649fa23ce4ad262027345dde250ee732a073c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 9 Nov 2025 11:25:35 +0000 Subject: [PATCH 4/4] :recycle: format code --- src/main/scala/controllers/NotifyController.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/scala/controllers/NotifyController.scala b/src/main/scala/controllers/NotifyController.scala index 47a6e80..155430e 100644 --- a/src/main/scala/controllers/NotifyController.scala +++ b/src/main/scala/controllers/NotifyController.scala @@ -3,7 +3,13 @@ package controllers import com.github.pjfanning.pekkohttpcirce.FailFastCirceSupport import org.apache.pekko.actor.typed.ActorSystem import org.apache.pekko.http.scaladsl.model.StatusCodes.{InternalServerError, OK} -import org.apache.pekko.http.scaladsl.server.Directives.{complete, get, headerValueByName, onComplete, path} +import org.apache.pekko.http.scaladsl.server.Directives.{ + complete, + get, + headerValueByName, + onComplete, + path +} import org.apache.pekko.http.scaladsl.server.Route import commons.Configuration import models.controller.NotifyResponse