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

This PR migrates Ditto to Apache Pekko #1730

Merged
merged 58 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
0e0241f
[#1592] provide "Bearer" authentication for devops resources controll…
thjaeckle Mar 6, 2023
a0fd0f1
[#1592] switched grouping of different auth* methods based on "main /…
thjaeckle Mar 7, 2023
7db85d7
prepare Ditto 3.2.0 release
thjaeckle Mar 7, 2023
2c9c189
post Ditto 3.2.0 release: update binary-compatibility-check to versio…
thjaeckle Mar 8, 2023
66e539d
post Ditto 3.2.0 release: update SECURITY.md
thjaeckle Mar 8, 2023
8613a16
Merge remote-tracking branch 'bosch-io/master'
Mar 13, 2023
0a44e22
Merge remote-tracking branch 'bosch-io/master'
Mar 17, 2023
c38724d
Merge remote-tracking branch 'bosch-io/master'
Mar 24, 2023
1b35510
Merge remote-tracking branch 'bosch-io/master'
Mar 29, 2023
a0aba9a
Merge remote-tracking branch 'bosch-io/master'
Mar 29, 2023
ba9b820
fixed OverflowStrategy in SupervisedStream to backpressure instead of…
thjaeckle Mar 30, 2023
fcac9fa
UI - New Operations tab (#1600)
thfries Mar 30, 2023
9d11565
fix in UI that "bearerDevOps" token is stored to local storage
thjaeckle Apr 1, 2023
73af3f7
provide release notes for Ditto 3.2.1
thjaeckle Apr 1, 2023
75e7280
#1593 support removing existing fields from a JSON object in a merge …
thjaeckle Apr 4, 2023
915e68b
#1593 added special "merge command" enforcement for patches including…
thjaeckle Apr 5, 2023
316edf6
Merge branch 'bosch-io'
Apr 18, 2023
f57e41f
#1619 adjusted monitor to use in OutboundMappingProcessorActor#messag…
thjaeckle Apr 18, 2023
6f90710
Merge branch 'bosch-io'
May 4, 2023
fc6a1ae
Merge remote-tracking branch 'bosch-io/master'
May 18, 2023
ba39bb0
Merge branch 'bosch-io'
alstanchev Jun 26, 2023
e363342
Merge branch 'bosch-io'
alstanchev Jul 7, 2023
e714aec
Merge remote-tracking branch 'bosch-io/master'
alstanchev Jul 17, 2023
bfff8fb
Merge remote-tracking branch 'bosch-io/master'
kalinkostashki Jul 28, 2023
9e1c1b9
Merge remote-tracking branch 'bosch-io/master'
alstanchev Aug 16, 2023
bb70917
Merge branch 'bosch-io'
alstanchev Aug 25, 2023
dc948ef
switch dependencies and imports to Pekko
alstanchev Aug 4, 2023
3589537
update documentation links
alstanchev Aug 4, 2023
3688eea
move repositories from bom to root pom
alstanchev Aug 8, 2023
baf14c5
fix some wrong package names
alstanchev Aug 8, 2023
8895ce5
fix ddata tests
alstanchev Aug 8, 2023
2ce8599
renamed somma Akka leftovers in javadocs
alstanchev Aug 8, 2023
f0d1a62
renamed somma AKKA_ in env variables to PEKKO_
alstanchev Aug 8, 2023
d34f982
ConnectionPerssistenceActor PLUGIN_ID to pekko
alstanchev Aug 8, 2023
265ba91
use ported pekko-persistence-inmemory
alstanchev Aug 10, 2023
7558cf5
fixed some other akka leftovers
alstanchev Aug 10, 2023
0ca675c
fix unit tests
alstanchev Aug 10, 2023
b53dc1b
dependency fix
alstanchev Aug 11, 2023
54b2794
pekko management to v 1.0.0
alstanchev Aug 14, 2023
75bf598
pekko-persistence-mongodb to v 1.0
alstanchev Aug 14, 2023
78353f5
alpakka to pekko-connectors migration
alstanchev Aug 14, 2023
a30fa0e
update NOTICE-THIRD-PARTY.md
alstanchev Aug 14, 2023
f3aa391
override pekko-serialization-jackson
alstanchev Aug 14, 2023
d0b1aae
try to fix pekko-serialization-jackson bad transitive version
alstanchev Aug 15, 2023
c06834b
update deployment/* files to pekko
alstanchev Aug 18, 2023
38096e5
update legal dependencies files
alstanchev Aug 18, 2023
6556895
some more akka leftovers in deployment
alstanchev Aug 23, 2023
dde02f2
switch pekko-persistence-inmemory to sonatype repo
alstanchev Aug 24, 2023
eec6253
set management port to Pekko's new default 7626
alstanchev Aug 25, 2023
95c937f
remove snapshot repos and fix inmemory plugin version
alstanchev Aug 25, 2023
588e7af
sync mongo java driver version with pekko-persistence-mongodb
alstanchev Aug 28, 2023
5926abd
pekko-persistence-mongodb version to 1.0.1, metadata-index name configs
alstanchev Aug 29, 2023
0a1d2b2
update documentation with migration steps
alstanchev Aug 30, 2023
73277b5
remove unneeded line from config
alstanchev Sep 5, 2023
a270162
move migration steps to a release_notes file
alstanchev Sep 11, 2023
d76b94f
Merge branch 'bosch-io'
alstanchev Sep 11, 2023
d90b045
Merge branch 'master' into feature/pekko-migration
alstanchev Sep 11, 2023
afe36ed
update changelog for 3.4.0 release
alstanchev Sep 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
cache: 'maven'

- name: Build with Maven
run: mvn package javadoc:jar source:jar --batch-mode --errors --quiet -DcreateJavadoc=true -Dakka.test.single-expect-default=10s --file pom.xml -Dbuild.environment=Github
run: mvn package javadoc:jar source:jar --batch-mode --errors --quiet -DcreateJavadoc=true -Dpekko.test.single-expect-default=10s --file pom.xml -Dbuild.environment=Github
4 changes: 2 additions & 2 deletions base/model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-testkit_${scala.version}</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public enum DittoHeaderDefinition implements HeaderDefinition {
HeaderValueValidators.getBooleanValidator()),

/**
* Internal header passing through the Akka address of an {@code AcknowledgementAggregatorActor} which was started
* Internal header passing through the Pekko address of an {@code AcknowledgementAggregatorActor} which was started
* at an edge (gateway/connectivity) and is awaiting {@code Acknowledgement}s which can be sent to it by using
* this address in an {@code ActorSelection}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
final class JsonFieldSelectorValidator extends AbstractHeaderValueValidator {

/**
* Don't configure URL decoding as JsonParseOptions because Akka-Http already decodes the fields-param and we would
* Don't configure URL decoding as JsonParseOptions because Pekko-Http already decodes the fields-param and we would
* decode twice.
*/
private static final JsonParseOptions JSON_FIELD_SELECTOR_PARSE_OPTIONS = JsonFactory.newParseOptionsBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
*/
package org.eclipse.ditto.base.model.signals;

import akka.actor.ActorSystem;
import akka.testkit.javadsl.TestKit;
import org.apache.pekko.actor.ActorSystem;
import org.apache.pekko.testkit.javadsl.TestKit;


/**
* Manage creation and termination of actor systems for tests.
Expand Down
30 changes: 15 additions & 15 deletions base/service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,35 @@
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-actor_${scala.version}</artifactId>
</dependency>

<dependency>
<groupId>com.lightbend.akka.management</groupId>
<artifactId>akka-management_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-management_${scala.version}</artifactId>
</dependency>
<dependency>
<groupId>com.lightbend.akka.management</groupId>
<artifactId>akka-management-cluster-bootstrap_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-management-cluster-bootstrap_${scala.version}</artifactId>
</dependency>
<dependency>
<groupId>com.lightbend.akka.management</groupId>
<artifactId>akka-management-cluster-http_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-management-cluster-http_${scala.version}</artifactId>
</dependency>

<dependency>
<groupId>com.lightbend.akka.discovery</groupId>
<artifactId>akka-discovery-kubernetes-api_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-discovery-kubernetes-api_${scala.version}</artifactId>
</dependency>
<dependency>
<groupId>com.lightbend.akka.management</groupId>
<artifactId>akka-lease-kubernetes_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-lease-kubernetes_${scala.version}</artifactId>
</dependency>

<dependency>
<groupId>com.github.scullxbones</groupId>
<artifactId>akka-persistence-mongo-common_${scala.version}</artifactId>
<artifactId>pekko-persistence-mongodb_${scala.version}</artifactId>
</dependency>

<dependency>
Expand Down Expand Up @@ -126,8 +126,8 @@

<!-- test scope -->
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_${scala.version}</artifactId>
<groupId>org.apache.pekko</groupId>
<artifactId>pekko-testkit_${scala.version}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@
import com.typesafe.config.ConfigValue;
import com.typesafe.config.ConfigValueFactory;

import akka.Done;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.CoordinatedShutdown;
import akka.actor.Props;
import akka.cluster.Cluster;
import akka.cluster.pubsub.DistributedPubSub;
import akka.http.javadsl.Http;
import akka.http.javadsl.model.Uri;
import akka.management.cluster.bootstrap.ClusterBootstrap;
import akka.management.javadsl.AkkaManagement;
import org.apache.pekko.Done;
import org.apache.pekko.actor.ActorRef;
import org.apache.pekko.actor.ActorSystem;
import org.apache.pekko.actor.CoordinatedShutdown;
import org.apache.pekko.actor.Props;
import org.apache.pekko.cluster.Cluster;
import org.apache.pekko.cluster.pubsub.DistributedPubSub;
import org.apache.pekko.http.javadsl.Http;
import org.apache.pekko.http.javadsl.model.Uri;
import org.apache.pekko.management.cluster.bootstrap.ClusterBootstrap;
import org.apache.pekko.management.javadsl.PekkoManagement;
import ch.qos.logback.classic.LoggerContext;
import kamon.Kamon;
import kamon.prometheus.PrometheusReporter;
Expand All @@ -71,11 +71,11 @@
* <ol>
* <li>{@link #determineRawConfig()},</li>
* <li>{@link #createActorSystem(com.typesafe.config.Config)},</li>
* <li>{@link #startStatusSupplierActor(akka.actor.ActorSystem)},</li>
* <li>{@link #startServiceRootActors(akka.actor.ActorSystem, org.eclipse.ditto.base.service.config.ServiceSpecificConfig)}.
* <li>{@link #startStatusSupplierActor(org.apache.pekko.actor.ActorSystem)},</li>
* <li>{@link #startServiceRootActors(org.apache.pekko.actor.ActorSystem, org.eclipse.ditto.base.service.config.ServiceSpecificConfig)}.
* <ol>
* <li>{@link #getMainRootActorProps(org.eclipse.ditto.base.service.config.ServiceSpecificConfig, akka.actor.ActorRef)},</li>
* <li>{@link #startMainRootActor(akka.actor.ActorSystem, akka.actor.Props)},</li>
* <li>{@link #getMainRootActorProps(org.eclipse.ditto.base.service.config.ServiceSpecificConfig, org.apache.pekko.actor.ActorRef)},</li>
* <li>{@link #startMainRootActor(org.apache.pekko.actor.ActorSystem, org.apache.pekko.actor.Props)},</li>
* </ol>
* </li>
* </ol>
Expand All @@ -95,7 +95,7 @@ public abstract class DittoService<C extends ServiceSpecificConfig> {
*/
public static final String DITTO_CONFIG_PATH = ScopedConfig.DITTO_SCOPE;

protected static final String MONGO_URI_CONFIG_PATH = "akka.contrib.persistence.mongodb.mongo.mongouri";
protected static final String MONGO_URI_CONFIG_PATH = "pekko.contrib.persistence.mongodb.mongo.mongouri";

protected final Config rawConfig;
protected final C serviceSpecificConfig;
Expand Down Expand Up @@ -207,15 +207,15 @@ private static ScopedConfig getDittoConfigOrEmpty(final Config rawConfig) {
*/
private ActorSystem doStart() {
logRuntimeParameters();
final var actorSystemConfig = appendDittoInfo(appendAkkaPersistenceMongoUriToRawConfig());
final var actorSystemConfig = appendDittoInfo(appendPekkoPersistenceMongoUriToRawConfig());
startKamon();
final var actorSystem = createActorSystem(actorSystemConfig);
initializeActorSystem(actorSystem);
startKamonPrometheusHttpEndpoint(actorSystem);
return actorSystem;
}

protected Config appendAkkaPersistenceMongoUriToRawConfig() {
protected Config appendPekkoPersistenceMongoUriToRawConfig() {
return rawConfig;
}

Expand Down Expand Up @@ -255,9 +255,9 @@ private void startPrometheusReporter() {
}

/**
* Starts the Akka actor system as well as all required actors.
* Starts the Pekko actor system as well as all required actors.
* <p>
* May be overridden to change the way how the Akka actor system and actors are started. <em>Note: If this method is
* May be overridden to change the way how the Pekko actor system and actors are started. <em>Note: If this method is
* overridden, none of the following mentioned methods and their descendant methods will be called
* automatically:</em>
* </p>
Expand All @@ -267,10 +267,10 @@ private void startPrometheusReporter() {
* <li>{@link #startServiceRootActors(ActorSystem, org.eclipse.ditto.base.service.config.ServiceSpecificConfig)}.</li>
* </ul>
*
* @param actorSystem the Akka ActorSystem to be initialized.
* @param actorSystem the Pekko ActorSystem to be initialized.
*/
private void initializeActorSystem(final ActorSystem actorSystem) {
startAkkaManagement(actorSystem);
startPekkoManagement(actorSystem);
startClusterBootstrap(actorSystem);

startStatusSupplierActor(actorSystem);
Expand Down Expand Up @@ -310,7 +310,7 @@ private void startKamonPrometheusHttpEndpoint(final ActorSystem actorSystem) {
}

/**
* Creates the Akka actor system. May be overridden to change the way how the actor system is created.
* Creates the Pekko actor system. May be overridden to change the way how the actor system is created.
*
* @param config the configuration settings of this service.
* @return the actor system.
Expand All @@ -319,15 +319,15 @@ private ActorSystem createActorSystem(final Config config) {
return ActorSystem.create(CLUSTER_NAME, config);
}

private void startAkkaManagement(final ActorSystem actorSystem) {
logger.info("Starting AkkaManagement ...");
final var akkaManagement = AkkaManagement.get(actorSystem);
final CompletionStage<Uri> startPromise = akkaManagement.start();
private void startPekkoManagement(final ActorSystem actorSystem) {
logger.info("Starting PekkoManagement ...");
final var pekkoManagement = PekkoManagement.get(actorSystem);
final CompletionStage<Uri> startPromise = pekkoManagement.start();
startPromise.whenComplete((uri, throwable) -> {
if (null != throwable) {
logger.error("Error during start of AkkaManagement: <{}>!", throwable.getMessage(), throwable);
logger.error("Error during start of PekkoManagement: <{}>!", throwable.getMessage(), throwable);
} else {
logger.info("Started AkkaManagement on URI <{}>.", uri);
logger.info("Started PekkoManagement on URI <{}>.", uri);
}
});
}
Expand All @@ -342,7 +342,7 @@ private void startClusterBootstrap(final ActorSystem actorSystem) {
* Starts the {@link org.eclipse.ditto.internal.utils.health.status.StatusSupplierActor}.
* May be overridden to change the way how the actor is started.
*
* @param actorSystem Akka actor system for starting actors.
* @param actorSystem Pekko actor system for starting actors.
*/
private void startStatusSupplierActor(final ActorSystem actorSystem) {
startActor(actorSystem, StatusSupplierActor.props(rootActorName), StatusSupplierActor.ACTOR_NAME);
Expand All @@ -361,7 +361,7 @@ private void logStartingActor(final String actorName) {
* Starts the {@link org.eclipse.ditto.base.service.devops.DevOpsCommandsActor}.
* May be overridden to change the way how the actor is started.
*
* @param actorSystem Akka actor system for starting actors.
* @param actorSystem Pekko actor system for starting actors.
*/
private void startDevOpsCommandsActor(final ActorSystem actorSystem) {
startActor(actorSystem, DevOpsCommandsActor.props(LogbackLoggingFacade.newInstance(), serviceName,
Expand All @@ -375,11 +375,11 @@ private void startDevOpsCommandsActor(final ActorSystem actorSystem) {
* is overridden, the following methods will not be called automatically:</em>
* </p>
* <ul>
* <li>{@link #getMainRootActorProps(org.eclipse.ditto.base.service.config.ServiceSpecificConfig, akka.actor.ActorRef)},</li>
* <li>{@link #startMainRootActor(akka.actor.ActorSystem, akka.actor.Props)},</li>
* <li>{@link #getMainRootActorProps(org.eclipse.ditto.base.service.config.ServiceSpecificConfig, org.apache.pekko.actor.ActorRef)},</li>
* <li>{@link #startMainRootActor(org.apache.pekko.actor.ActorSystem, org.apache.pekko.actor.Props)},</li>
* </ul>
*
* @param actorSystem Akka actor system for starting actors.
* @param actorSystem Pekko actor system for starting actors.
* @param serviceSpecificConfig the configuration settings of this service.
*/
private void startServiceRootActors(final ActorSystem actorSystem, final C serviceSpecificConfig) {
Expand Down Expand Up @@ -437,7 +437,7 @@ private static ActorRef getDistributedPubSubMediatorActor(final ActorSystem acto
* Starts the main root actor of this service. May be overridden to change the way of starting this service's root
* actor.
*
* @param actorSystem Akka actor system for starting actors.
* @param actorSystem Pekko actor system for starting actors.
* @param mainRootActorProps the Props of the main root actor.
*/
private ActorRef startMainRootActor(final ActorSystem actorSystem, final Props mainRootActorProps) {
Expand All @@ -452,9 +452,9 @@ private void setUpCoordinatedShutdown(final ActorSystem actorSystem) {
logger.info("Initiated coordinated shutdown; gracefully shutting down ...");
coordinatedShutdown.getShutdownReason().ifPresent(reason ->
logger.info("Shutdown reason was - <{}>", reason));
final CompletionStage<Done> stop = AkkaManagement.get(actorSystem).stop();
final CompletionStage<Done> stop = PekkoManagement.get(actorSystem).stop();
return stop.thenApply(done -> {
logger.info("AkkaManagement stopped!");
logger.info("PekkoManagement stopped!");
return done;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;

import akka.actor.ExtendedActorSystem;
import akka.discovery.Lookup;
import akka.discovery.ServiceDiscovery;
import akka.dispatch.Futures;
import akka.pattern.Patterns;
import org.apache.pekko.actor.ExtendedActorSystem;
import org.apache.pekko.discovery.Lookup;
import org.apache.pekko.discovery.ServiceDiscovery;
import org.apache.pekko.dispatch.Futures;
import org.apache.pekko.pattern.Patterns;
import scala.Option;
import scala.collection.JavaConverters;
import scala.concurrent.Future;
Expand All @@ -35,7 +35,7 @@
* <p>
* One speciality of a Docker swarm based cluster is that the Docker swarm DNS sets a TTL of DNS entries to 600 seconds
* (10 minutes) - so if a cluster forms and not all DNS entries are "there" from the beginning, it takes 10 minutes
* until DNS caches used by the default Akka {@link akka.discovery.dns.DnsServiceDiscovery DnsServiceDiscovery} are
* until DNS caches used by the default Pekko {@link org.apache.pekko.discovery.dns.DnsServiceDiscovery DnsServiceDiscovery} are
* evicted and another DNS lookup is done.
* </p>
* This implementation does not cache DNS entries and can therefore be used for bootstrapping in Docker swarm.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import org.slf4j.Logger;

import akka.actor.ActorSystem;
import org.apache.pekko.actor.ActorSystem;

/**
* This class wraps the execution of a Runnable for catching {@code Throwable}s. The Runnable is assumed to be the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import com.typesafe.config.Config;

import akka.actor.ActorSystem;
import org.apache.pekko.actor.ActorSystem;

/**
* Root actor starter that does purposefully nothing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import com.typesafe.config.Config;

import akka.actor.ActorContext;
import akka.actor.ActorSystem;
import org.apache.pekko.actor.ActorContext;
import org.apache.pekko.actor.ActorSystem;

/**
* Root actor child starter that does purposefully nothing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import com.typesafe.config.Config;

import akka.actor.ActorSystem;
import org.apache.pekko.actor.ActorSystem;

/**
* Extension to start custom root actors in service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import com.typesafe.config.Config;

import akka.actor.ActorContext;
import akka.actor.ActorSystem;
import org.apache.pekko.actor.ActorContext;
import org.apache.pekko.actor.ActorSystem;

/**
* Extension to start custom child actors in root actor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public final class UriEncoding {
private static final IntPredicate ALLOWED_IN_PATH_SEGMENT = UriEncoding::isPchar;
/*
* Workaround: '+' needs to be escaped to '%2B', otherwise it will be recognized as blank when decoding with MIME
* format {@code application/x-www-form-urlencoded} - what most servers do (such as akka-http).
* format {@code application/x-www-form-urlencoded} - what most servers do (such as pekko-http).
*/
private static final IntPredicate ALLOWED_IN_QUERY = c -> c != '+' && (isPchar(c) || '/' == c || '?' == c);
private static final IntPredicate ALLOWED_IN_QUERY_PARAM =
Expand Down
Loading
Loading