diff --git a/odata_service/pom.xml b/odata_service/pom.xml index 5a0c26f5..d877f07b 100644 --- a/odata_service/pom.xml +++ b/odata_service/pom.xml @@ -56,12 +56,12 @@ jakarta.annotation-api - com.typesafe.akka - akka-actor_2.12 + org.apache.pekko + pekko-actor_2.12 - com.typesafe.akka - akka-slf4j_2.12 + org.apache.pekko + pekko-slf4j_2.12 org.scalatest @@ -69,8 +69,8 @@ test - com.typesafe.akka - akka-testkit_2.12 + org.apache.pekko + pekko-testkit_2.12 diff --git a/odata_service/src/main/java/com/sdl/odata/service/ODataServiceConfiguration.java b/odata_service/src/main/java/com/sdl/odata/service/ODataServiceConfiguration.java index a2cd6321..899e2dd2 100644 --- a/odata_service/src/main/java/com/sdl/odata/service/ODataServiceConfiguration.java +++ b/odata_service/src/main/java/com/sdl/odata/service/ODataServiceConfiguration.java @@ -50,7 +50,7 @@ import javax.annotation.PostConstruct; -import static com.sdl.odata.service.util.AkkaUtil.registerRoute; +import static com.sdl.odata.service.util.PekkoUtil.registerRoute; /** * The OData Service Configuration. diff --git a/odata_service/src/main/java/com/sdl/odata/service/spring/ActorProducer.java b/odata_service/src/main/java/com/sdl/odata/service/spring/ActorProducer.java index 8f5e0d8f..d1c8a968 100644 --- a/odata_service/src/main/java/com/sdl/odata/service/spring/ActorProducer.java +++ b/odata_service/src/main/java/com/sdl/odata/service/spring/ActorProducer.java @@ -15,20 +15,20 @@ */ package com.sdl.odata.service.spring; -import akka.actor.ActorContext; -import akka.actor.ActorRef; -import akka.actor.ActorSystem; -import akka.actor.Props; +import org.apache.pekko.actor.ActorContext; +import org.apache.pekko.actor.ActorRef; +import org.apache.pekko.actor.ActorSystem; +import org.apache.pekko.actor.Props; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * The ActorProducer is responsible for creating Akka actors that are using Spring dependency injection. + * The ActorProducer is responsible for creating Pekko actors that are using Spring dependency injection. */ @Component public class ActorProducer { @Autowired - private AkkaSpringExtension akkaSpringExtension; + private PekkoSpringExtension pekkoSpringExtension; @Autowired private ActorSystem actorSystem; @@ -55,6 +55,6 @@ public ActorRef actorRef(String actorId, ActorContext context) { } public Props create(String actorId) { - return akkaSpringExtension.get(actorSystem).props(actorId); + return pekkoSpringExtension.get(actorSystem).props(actorId); } } diff --git a/odata_service/src/main/java/com/sdl/odata/service/spring/AkkaConfiguration.java b/odata_service/src/main/java/com/sdl/odata/service/spring/PekkoConfiguration.java similarity index 72% rename from odata_service/src/main/java/com/sdl/odata/service/spring/AkkaConfiguration.java rename to odata_service/src/main/java/com/sdl/odata/service/spring/PekkoConfiguration.java index e14b4647..4b2db84d 100644 --- a/odata_service/src/main/java/com/sdl/odata/service/spring/AkkaConfiguration.java +++ b/odata_service/src/main/java/com/sdl/odata/service/spring/PekkoConfiguration.java @@ -15,7 +15,7 @@ */ package com.sdl.odata.service.spring; -import akka.actor.ActorSystem; +import org.apache.pekko.actor.ActorSystem; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -24,23 +24,23 @@ import org.springframework.stereotype.Component; /** - * The AkkaConfiguration initializes an Akka Spring configured ActorSystem using the Spring extension. + * The PekkoConfiguration initializes an Pekko Spring configured ActorSystem using the Spring extension. */ @Component -public class AkkaConfiguration { - private static final Logger LOG = LoggerFactory.getLogger(AkkaConfiguration.class); +public class PekkoConfiguration { + private static final Logger LOG = LoggerFactory.getLogger(PekkoConfiguration.class); @Autowired private ApplicationContext applicationContext; @Autowired - private AkkaSpringExtension akkaSpringExtension; + private PekkoSpringExtension pekkoSpringExtension; @Bean(destroyMethod = "terminate") public ActorSystem actorSystem() { LOG.info("Creating actor system"); - ActorSystem system = ActorSystem.create("ODataAkkaSpringContext"); - akkaSpringExtension.get(system).initialize(applicationContext); + ActorSystem system = ActorSystem.create("ODataPekkoSpringContext"); + pekkoSpringExtension.get(system).initialize(applicationContext); return system; } } diff --git a/odata_service/src/main/java/com/sdl/odata/service/spring/AkkaSpringActorProducer.java b/odata_service/src/main/java/com/sdl/odata/service/spring/PekkoSpringActorProducer.java similarity index 78% rename from odata_service/src/main/java/com/sdl/odata/service/spring/AkkaSpringActorProducer.java rename to odata_service/src/main/java/com/sdl/odata/service/spring/PekkoSpringActorProducer.java index ba0e86f3..05483c2f 100644 --- a/odata_service/src/main/java/com/sdl/odata/service/spring/AkkaSpringActorProducer.java +++ b/odata_service/src/main/java/com/sdl/odata/service/spring/PekkoSpringActorProducer.java @@ -15,19 +15,19 @@ */ package com.sdl.odata.service.spring; -import akka.actor.Actor; -import akka.actor.IndirectActorProducer; +import org.apache.pekko.actor.Actor; +import org.apache.pekko.actor.IndirectActorProducer; import org.springframework.context.ApplicationContext; /** - * The AkkaSpringActorProducer has a reference to the spring context and is responsible + * The PekkoSpringActorProducer has a reference to the spring context and is responsible * for retrieving the actor based Bean from the Spring context. */ -public class AkkaSpringActorProducer implements IndirectActorProducer { +public class PekkoSpringActorProducer implements IndirectActorProducer { private ApplicationContext applicationContext; private String beanName; - public AkkaSpringActorProducer(ApplicationContext applicationContext, String beanName) { + public PekkoSpringActorProducer(ApplicationContext applicationContext, String beanName) { this.applicationContext = applicationContext; this.beanName = beanName; } diff --git a/odata_service/src/main/java/com/sdl/odata/service/spring/AkkaSpringExtension.java b/odata_service/src/main/java/com/sdl/odata/service/spring/PekkoSpringExtension.java similarity index 62% rename from odata_service/src/main/java/com/sdl/odata/service/spring/AkkaSpringExtension.java rename to odata_service/src/main/java/com/sdl/odata/service/spring/PekkoSpringExtension.java index 00180c6a..26379ee4 100644 --- a/odata_service/src/main/java/com/sdl/odata/service/spring/AkkaSpringExtension.java +++ b/odata_service/src/main/java/com/sdl/odata/service/spring/PekkoSpringExtension.java @@ -15,28 +15,28 @@ */ package com.sdl.odata.service.spring; -import akka.actor.AbstractExtensionId; -import akka.actor.ExtendedActorSystem; -import akka.actor.Extension; -import akka.actor.Props; +import org.apache.pekko.actor.AbstractExtensionId; +import org.apache.pekko.actor.ExtendedActorSystem; +import org.apache.pekko.actor.Extension; +import org.apache.pekko.actor.Props; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Component; /** - * The AkkaSpringExtension registers the Spring hook into the Akka extension system. + * The PekkoSpringExtension registers the Spring hook into the Pekko extension system. */ @Component -public class AkkaSpringExtension extends AbstractExtensionId { +public class PekkoSpringExtension extends AbstractExtensionId { @Override - public AkkaExtension createExtension(ExtendedActorSystem system) { - return new AkkaExtension(); + public PekkoExtension createExtension(ExtendedActorSystem system) { + return new PekkoExtension(); } /** - * The Akka Extension. + * The Pekko Extension. */ - public static class AkkaExtension implements Extension { + public static class PekkoExtension implements Extension { private volatile ApplicationContext applicationContext; public void initialize(ApplicationContext ctx) { @@ -44,7 +44,7 @@ public void initialize(ApplicationContext ctx) { } public Props props(String actor) { - return Props.create(AkkaSpringActorProducer.class, applicationContext, actor); + return Props.create(PekkoSpringActorProducer.class, applicationContext, actor); } } } diff --git a/odata_service/src/main/resources/application.conf b/odata_service/src/main/resources/application.conf index 4b44fcb1..de1e7a45 100644 --- a/odata_service/src/main/resources/application.conf +++ b/odata_service/src/main/resources/application.conf @@ -1,9 +1,9 @@ -akka { - loggers = ["akka.event.slf4j.Slf4jLogger"] +pekko { + loggers = ["org.apache.pekko.event.slf4j.Slf4jLogger"] loglevel = "ERROR" - # Log level for the very basic logger activated during AkkaApplication startup + # Log level for the very basic logger activated during PekkoApplication startup # Options: OFF, ERROR, WARNING, INFO, DEBUG stdout-loglevel = "ERROR" actor { @@ -53,4 +53,4 @@ akka { } } -} \ No newline at end of file +} diff --git a/odata_service/src/main/scala/com/sdl/odata/service/ODataServiceImpl.scala b/odata_service/src/main/scala/com/sdl/odata/service/ODataServiceImpl.scala index 2db066eb..52878271 100644 --- a/odata_service/src/main/scala/com/sdl/odata/service/ODataServiceImpl.scala +++ b/odata_service/src/main/scala/com/sdl/odata/service/ODataServiceImpl.scala @@ -17,9 +17,9 @@ package com.sdl.odata.service import java.util.concurrent.TimeUnit.MILLISECONDS -import akka.actor.PoisonPill -import akka.pattern.ask -import akka.util.Timeout +import org.apache.pekko.actor.PoisonPill +import org.apache.pekko.pattern.ask +import org.apache.pekko.util.Timeout import com.sdl.odata.api.service.{ODataRequest, ODataResponse, ODataService} import com.sdl.odata.service.actor.ODataMessageRouter import com.sdl.odata.service.protocol.{InitialServiceRequest, ServiceResponse} diff --git a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataActor.scala b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataActor.scala index 39fe6f75..9d75a88a 100644 --- a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataActor.scala +++ b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataActor.scala @@ -15,8 +15,8 @@ */ package com.sdl.odata.service.actor -import akka.actor.SupervisorStrategy.Escalate -import akka.actor.{Actor, ActorLogging, OneForOneStrategy, SupervisorStrategy} +import org.apache.pekko.actor.SupervisorStrategy.Escalate +import org.apache.pekko.actor.{Actor, ActorLogging, OneForOneStrategy, SupervisorStrategy} trait ODataActor extends Actor with ActorLogging { override def supervisorStrategy: SupervisorStrategy = OneForOneStrategy() { diff --git a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataBatchProcessorActor.scala b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataBatchProcessorActor.scala index 2b179419..2c3ced61 100644 --- a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataBatchProcessorActor.scala +++ b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataBatchProcessorActor.scala @@ -29,7 +29,7 @@ import com.sdl.odata.unmarshaller.atom.ODataAtomParser import com.sdl.odata.unmarshaller.json.ODataJsonParser import com.sdl.odata.service.protocol.{BatchOperation, BatchOperationResult} import com.sdl.odata.service.spring.ActorProducer -import com.sdl.odata.service.util.AkkaUtil._ +import com.sdl.odata.service.util.PekkoUtil._ import org.springframework.beans.factory.annotation.Autowired import org.springframework.context.annotation.Scope import org.springframework.stereotype.Component diff --git a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataMessageRouter.scala b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataMessageRouter.scala index b945f580..15004d14 100644 --- a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataMessageRouter.scala +++ b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataMessageRouter.scala @@ -15,13 +15,13 @@ */ package com.sdl.odata.service.actor -import akka.actor.SupervisorStrategy.{Resume, Stop} -import akka.actor._ +import org.apache.pekko.actor.SupervisorStrategy.{Resume, Stop} +import org.apache.pekko.actor._ import com.sdl.odata.api.edm.registry.ODataEdmRegistry import com.sdl.odata.api.service.ODataRequestContext import com.sdl.odata.service.protocol._ import com.sdl.odata.service.spring.ActorProducer -import com.sdl.odata.service.util.AkkaUtil +import com.sdl.odata.service.util.PekkoUtil import org.slf4j.{Logger, LoggerFactory} import org.springframework.beans.factory.annotation.Autowired import org.springframework.context.annotation.Scope @@ -38,7 +38,7 @@ import org.springframework.stereotype.Component class ODataMessageRouter @Autowired()(serviceRegistry: ODataEdmRegistry, actorProducer: ActorProducer) extends ODataActor { import com.sdl.odata.service.actor.MessageHandlerRegistry._ import com.sdl.odata.service.actor.ODataMessageRouter._ - import AkkaUtil._ + import PekkoUtil._ var origin: Option[ActorRef] = None var requestContext: Option[ODataRequestContext] = None diff --git a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataParserActor.scala b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataParserActor.scala index 92677c2c..6a79ad80 100644 --- a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataParserActor.scala +++ b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataParserActor.scala @@ -26,7 +26,7 @@ import org.springframework.stereotype.Component @Scope("prototype") class ODataParserActor @Autowired()(actorProducer: ActorProducer, parser: ODataParser) extends ODataActor { - import com.sdl.odata.service.util.AkkaUtil.routeMessage + import com.sdl.odata.service.util.PekkoUtil.routeMessage def receive = { case ServiceRequest(actorContext) => diff --git a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataQueryProcessorActor.scala b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataQueryProcessorActor.scala index b1c8f790..e6c896a9 100644 --- a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataQueryProcessorActor.scala +++ b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataQueryProcessorActor.scala @@ -19,7 +19,7 @@ import com.sdl.odata.api.parser.ODataUriUtil.isFunctionCallUri import com.sdl.odata.api.processor.{ODataFunctionProcessor, ODataQueryProcessor} import com.sdl.odata.service.protocol.{ReadOperation, Render} import com.sdl.odata.service.spring.ActorProducer -import com.sdl.odata.service.util.AkkaUtil._ +import com.sdl.odata.service.util.PekkoUtil._ import org.springframework.beans.factory.annotation.Autowired import org.springframework.context.annotation.Scope import org.springframework.stereotype.Component diff --git a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataRequestProcessorActor.scala b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataRequestProcessorActor.scala index 06573d11..95c04e23 100644 --- a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataRequestProcessorActor.scala +++ b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataRequestProcessorActor.scala @@ -19,7 +19,7 @@ import com.sdl.odata.api.service.ODataRequestContextUtil.{checkSupportedType, is import com.sdl.odata.parser.ODataBatchRequestContent import com.sdl.odata.service.protocol._ import com.sdl.odata.service.spring.ActorProducer -import com.sdl.odata.service.util.AkkaUtil._ +import com.sdl.odata.service.util.PekkoUtil._ import org.springframework.beans.factory.annotation.Autowired import org.springframework.context.annotation.Scope import org.springframework.stereotype.Component diff --git a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataUnmarshallerActor.scala b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataUnmarshallerActor.scala index 99e485a5..00a0948e 100644 --- a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataUnmarshallerActor.scala +++ b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataUnmarshallerActor.scala @@ -19,7 +19,7 @@ import com.sdl.odata.api.ODataSystemException import com.sdl.odata.api.unmarshaller.{ODataUnmarshaller, UnmarshallerFactory} import com.sdl.odata.service.protocol.{ODataActorContext, Unmarshall, UnmarshallResult} import com.sdl.odata.service.spring.ActorProducer -import com.sdl.odata.service.util.AkkaUtil._ +import com.sdl.odata.service.util.PekkoUtil._ import org.springframework.beans.factory.annotation.Autowired import org.springframework.context.annotation.Scope import org.springframework.stereotype.Component diff --git a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataWriteProcessorActor.scala b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataWriteProcessorActor.scala index 4d89e2df..24f5cb11 100644 --- a/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataWriteProcessorActor.scala +++ b/odata_service/src/main/scala/com/sdl/odata/service/actor/ODataWriteProcessorActor.scala @@ -18,7 +18,7 @@ package com.sdl.odata.service.actor import com.sdl.odata.api.processor.ODataWriteProcessor import com.sdl.odata.service.protocol.{OperationResult, WriteOperation} import com.sdl.odata.service.spring.ActorProducer -import com.sdl.odata.service.util.AkkaUtil._ +import com.sdl.odata.service.util.PekkoUtil._ import org.springframework.beans.factory.annotation.Autowired import org.springframework.context.annotation.Scope import org.springframework.stereotype.Component diff --git a/odata_service/src/main/scala/com/sdl/odata/service/protocol/ODataActorMessage.scala b/odata_service/src/main/scala/com/sdl/odata/service/protocol/ODataActorMessage.scala index 1f692561..6123eeb8 100644 --- a/odata_service/src/main/scala/com/sdl/odata/service/protocol/ODataActorMessage.scala +++ b/odata_service/src/main/scala/com/sdl/odata/service/protocol/ODataActorMessage.scala @@ -15,7 +15,7 @@ */ package com.sdl.odata.service.protocol -import akka.actor.ActorRef +import org.apache.pekko.actor.ActorRef import com.sdl.odata.api.parser.ODataUri import com.sdl.odata.api.processor.ProcessorResult import com.sdl.odata.api.service.{ODataRequest, ODataRequestContext, ODataResponse} diff --git a/odata_service/src/main/scala/com/sdl/odata/service/util/AkkaUtil.scala b/odata_service/src/main/scala/com/sdl/odata/service/util/PekkoUtil.scala similarity index 90% rename from odata_service/src/main/scala/com/sdl/odata/service/util/AkkaUtil.scala rename to odata_service/src/main/scala/com/sdl/odata/service/util/PekkoUtil.scala index 30515aba..f76b7795 100644 --- a/odata_service/src/main/scala/com/sdl/odata/service/util/AkkaUtil.scala +++ b/odata_service/src/main/scala/com/sdl/odata/service/util/PekkoUtil.scala @@ -15,7 +15,7 @@ */ package com.sdl.odata.service.util -import akka.actor.{Actor, ActorContext, ActorRef} +import org.apache.pekko.actor.{Actor, ActorContext, ActorRef} import com.sdl.odata.service.actor.MessageHandlerRegistry._ import com.sdl.odata.service.actor.ODataMessageRouter import com.sdl.odata.service.protocol.{ODataActorMessage, RegisterMessageHandler} @@ -23,11 +23,11 @@ import com.sdl.odata.service.spring.ActorProducer import org.slf4j.{Logger, LoggerFactory} /** - * Akka Util Class is resppnsible for registering routes for actors. + * Pekko Util Class is responsible for registering routes for actors. * */ -object AkkaUtil { - private val logger: Logger = LoggerFactory.getLogger("AkkaUtil") +object PekkoUtil { + private val logger: Logger = LoggerFactory.getLogger("PekkoUtil") def registerRoute(messageType: Class[_ <: ODataActorMessage], actorType: Class[_ <: Actor])(implicit producer: ActorProducer) { messageRouter().tell(RegisterMessageHandler(messageType, actorType.getSimpleName), null) diff --git a/odata_service/src/test/scala/com/sdl/odata/service/StopSystemAfterAll.scala b/odata_service/src/test/scala/com/sdl/odata/service/StopSystemAfterAll.scala index 59d07825..e69ea86b 100644 --- a/odata_service/src/test/scala/com/sdl/odata/service/StopSystemAfterAll.scala +++ b/odata_service/src/test/scala/com/sdl/odata/service/StopSystemAfterAll.scala @@ -16,7 +16,7 @@ package com.sdl.odata.service import org.scalatest.{Suite, BeforeAndAfterAll} -import akka.testkit.TestKit +import org.apache.pekko.testkit.TestKit trait StopSystemAfterAll extends BeforeAndAfterAll { this: TestKit with Suite => diff --git a/pom.xml b/pom.xml index 6afb167a..1566cf9b 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,6 @@ 17 - 2.6.20 4.13.6 33.2.0-jre 4.5.14 @@ -98,8 +97,9 @@ 0.8.11 1.3.5 5.8.2 - 4.5.1 1.2.13 + 4.5.1 + 1.0.2 0.18_${scala.version} 2.1.1 2.12.15 @@ -109,7 +109,7 @@ 2.7.18 5.3.35 9.0.89 - 1.4.2 + 1.4.3 2.12.2 1.1.2 @@ -178,16 +178,16 @@ ${jakarta-annotation-api.version} - + - com.typesafe.akka - akka-actor_2.12 - ${akka.version} + org.apache.pekko + pekko-actor_2.12 + ${pekko.version} - com.typesafe.akka - akka-slf4j_2.12 - ${akka.version} + org.apache.pekko + pekko-slf4j_2.12 + ${pekko.version} com.typesafe @@ -235,9 +235,9 @@ test - com.typesafe.akka - akka-testkit_2.12 - ${akka.version} + org.apache.pekko + pekko-testkit_2.12 + ${pekko.version} test diff --git a/readme.md b/readme.md index 6894bd2e..8a27b0c9 100644 --- a/readme.md +++ b/readme.md @@ -71,7 +71,7 @@ The Tridion OData v4 Framework consists of the following Architecture components - `odata_parser` - OData URI parser - `odata_processor` - Handlers for processing requests - `odata_renderer` - Renderers for Atom and JSON output -- `odata_service` - The core OData service and Akka based processing engine +- `odata_service` - The core OData service and Pekko based processing engine - `odata_test` - Test components - `odata_war` - OData WAR distribution artifact - `odata_webservice` - Spring Boot based OData HTTP webservice container