Skip to content

Commit

Permalink
Migrate from Akka to Pekko (#8)
Browse files Browse the repository at this point in the history
* Update project dependencies and release drafter

* Update migration module

* Update core module
  • Loading branch information
DybekK authored Feb 7, 2024
1 parent e463fda commit 3465c63
Show file tree
Hide file tree
Showing 124 changed files with 713 additions and 714 deletions.
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Config for https://github.com/toolmantim/release-drafter
name-template: 'Akka Persistence Postgres $NEXT_PATCH_VERSION'
name-template: 'Pekko Persistence Postgres $NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'

categories:
Expand All @@ -10,7 +10,7 @@ categories:
- title: 'Dependency changes'
label: 'dependency-change'

change-template: '- $TITLE [#$NUMBER](https://github.com/SwissBorg/akka-persistence-postgres/issues/$NUMBER) by [@$AUTHOR](https://github.com/$AUTHOR)'
change-template: '- $TITLE [#$NUMBER](https://github.com/SwissBorg/pekko-persistence-postgres/issues/$NUMBER) by [@$AUTHOR](https://github.com/$AUTHOR)'

template: |
## Changes
Expand Down
1 change: 0 additions & 1 deletion .scala-steward.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pullRequests.frequency = "1 day"

updates.ignore = [
{ groupId = "com.typesafe.akka" },
{ groupId = "org.scalameta", artifactId = "scalafmt-core" }
]

6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import com.typesafe.tools.mima.plugin.MimaKeys.mimaBinaryIssueFilters

lazy val `akka-persistence-postgres` = project
lazy val `pekko-persistence-postgres` = project
.in(file("."))
.enablePlugins(ScalaUnidocPlugin)
.disablePlugins(MimaPlugin)
Expand All @@ -11,15 +11,15 @@ lazy val core = project
.in(file("core"))
.enablePlugins(MimaPlugin)
.settings(
name := "akka-persistence-postgres",
name := "pekko-persistence-postgres",
libraryDependencies ++= Dependencies.Libraries,
mimaBinaryIssueFilters ++= Seq())

lazy val migration = project
.in(file("migration"))
.disablePlugins(MimaPlugin)
.settings(
name := "akka-persistence-postgres-migration",
name := "pekko-persistence-postgres-migration",
libraryDependencies ++= Dependencies.Migration,
Test / parallelExecution := false)
.dependsOn(core)
Expand Down
90 changes: 45 additions & 45 deletions core/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

akka-persistence-postgres {
pekko-persistence-postgres {

# If set to true event deletion is performed as a soft, logical delete. Events are kept in the journal and are sill
# delivered in queries. Otherwise, a hard delete will be performed.
Expand All @@ -25,7 +25,7 @@ akka-persistence-postgres {
#
logicalDeletion.enable = true

database-provider-fqcn = "akka.persistence.postgres.db.DefaultSlickDatabaseProvider"
database-provider-fqcn = "org.apache.pekko.persistence.postgres.db.DefaultSlickDatabaseProvider"

shared-databases {
// Shared databases can be defined here.
Expand All @@ -43,15 +43,15 @@ akka-persistence-postgres {

# The JDBC URL for the chosen database
# (uncomment and set the property below to match your needs)
# url = "jdbc:postgresql://localhost:5432/akka-plugin"
# url = "jdbc:postgresql://localhost:5432/pekko-plugin"

# The database username
# (uncomment and set the property below to match your needs)
# user = "akka-plugin"
# user = "pekko-plugin"

# The username's password
# (uncomment and set the property below to match your needs)
# password = "akka-plugin"
# password = "pekko-plugin"

# hikariCP settings; see: https://github.com/brettwooldridge/HikariCP
# Slick will use an async executor with a fixed size queue of 10.000 objects
Expand Down Expand Up @@ -99,14 +99,14 @@ akka-persistence-postgres {
}
}

# the akka-persistence-journal in use
# the pekko-persistence-journal in use
postgres-journal {
class = "akka.persistence.postgres.journal.PostgresAsyncWriteJournal"
class = "org.apache.pekko.persistence.postgres.journal.PostgresAsyncWriteJournal"

tables {
journal {
# Used by akka.persistence.postgres.journal.dao.NestedPartitionsJournalDao
# and akka.persistence.postgres.journal.dao.PartitionedJournalDao
# Used by org.apache.pekko.persistence.postgres.journal.dao.NestedPartitionsJournalDao
# and org.apache.pekko.persistence.postgres.journal.dao.PartitionedJournalDao
partitions {
# The size of a single partition
size: 10000000
Expand Down Expand Up @@ -147,12 +147,12 @@ postgres-journal {
}
}

# Replace with "akka.persistence.postgres.journal.dao.NestedPartitionsJournalDao"
# or "akka.persistence.postgres.journal.dao.PartitionedJournalDao" in order to enable
# Replace with "org.apache.pekko.persistence.postgres.journal.dao.NestedPartitionsJournalDao"
# or "org.apache.pekko.persistence.postgres.journal.dao.PartitionedJournalDao" in order to enable
# partitioning.
dao = "akka.persistence.postgres.journal.dao.FlatJournalDao"
dao = "org.apache.pekko.persistence.postgres.journal.dao.FlatJournalDao"

# Confguration for akka.persistence.postgres.tag.TagIdResolver
# Confguration for org.apache.pekko.persistence.postgres.tag.TagIdResolver
tags {
# The timeout after unused tag is removed from the TagIdResolver's cache
cacheTtl = 1 hour
Expand All @@ -172,16 +172,16 @@ postgres-journal {
parallelism = 8

# Only mark as deleted. If false, delete physically
# should not be configured directly, but through property akka-persistence-postgres.logicalDelete.enable
# should not be configured directly, but through property pekko-persistence-postgres.logicalDelete.enable
# in order to keep consistent behavior over write/read sides
logicalDelete = ${akka-persistence-postgres.logicalDeletion.enable}
logicalDelete = ${pekko-persistence-postgres.logicalDeletion.enable}

# This setting can be used to configure usage of a shared database.
# To disable usage of a shared database, set to null or an empty string.
# When set to a non emty string, this setting does two things:
# When set to a non empty string, this setting does two things:
# - The actor which manages the write-journal will not automatically close the db when the actor stops (since it is shared)
# - If akka-persistence-postgres.database-provider-fqcn is set to akka.persistence.postgres.db.DefaultSlickDatabaseProvider
# then the shared database with the given name will be used. (shared databases are configured as part of akka-persistence-postgres.shared-databases)
# - If pekko-persistence-postgres.database-provider-fqcn is set to org.apache.pekko.persistence.postgres.db.DefaultSlickDatabaseProvider
# then the shared database with the given name will be used. (shared databases are configured as part of pekko-persistence-postgres.shared-databases)
# Please note that the database will only be shared with the other journals if the use-shared-db is also set
# to the same value for these other journals.
use-shared-db = null
Expand All @@ -201,15 +201,15 @@ postgres-journal {

# The JDBC URL for the chosen database
# (uncomment and set the property below to match your needs)
# url = "jdbc:postgresql://localhost:5432/akka-plugin"
# url = "jdbc:postgresql://localhost:5432/pekko-plugin"

# The database username
# (uncomment and set the property below to match your needs)
# user = "akka-plugin"
# user = "pekko-plugin"

# The username's password
# (uncomment and set the property below to match your needs)
# password = "akka-plugin"
# password = "pekko-plugin"

# hikariCP settings; see: https://github.com/brettwooldridge/HikariCP
# Slick will use an async executor with a fixed size queue of 10.000 objects
Expand Down Expand Up @@ -256,9 +256,9 @@ postgres-journal {
}
}

# the akka-persistence-snapshot-store in use
# the pekko-persistence-snapshot-store in use
postgres-snapshot-store {
class = "akka.persistence.postgres.snapshot.PostgresSnapshotStore"
class = "org.apache.pekko.persistence.postgres.snapshot.PostgresSnapshotStore"

tables {
snapshot {
Expand All @@ -276,15 +276,15 @@ postgres-snapshot-store {

# This setting can be used to configure usage of a shared database.
# To disable usage of a shared database, set to null or an empty string.
# When set to a non emty string, this setting does two things:
# When set to a non empty string, this setting does two things:
# - The actor which manages the snapshot-journal will not automatically close the db when the actor stops (since it is shared)
# - If akka-persistence-postgres.database-provider-fqcn is set to akka.persistence.postgres.db.DefaultSlickDatabaseProvider
# then the shared database with the given name will be used. (shared databases are configured as part of akka-persistence-postgres.shared-databases)
# - If pekko-persistence-postgres.database-provider-fqcn is set to org.apache.pekko.persistence.postgres.db.DefaultSlickDatabaseProvider
# then the shared database with the given name will be used. (shared databases are configured as part of pekko-persistence-postgres.shared-databases)
# Please note that the database will only be shared with the other journals if the use-shared-db is also set
# to the same value for these other journals.
use-shared-db = null

dao = "akka.persistence.postgres.snapshot.dao.ByteArraySnapshotDao"
dao = "org.apache.pekko.persistence.postgres.snapshot.dao.ByteArraySnapshotDao"

slick {

Expand All @@ -293,15 +293,15 @@ postgres-snapshot-store {

# The JDBC URL for the chosen database
# (uncomment and set the property below to match your needs)
# url = "jdbc:postgresql://localhost:5432/akka-plugin"
# url = "jdbc:postgresql://localhost:5432/pekko-plugin"

# The database username
# (uncomment and set the property below to match your needs)
# user = "akka-plugin"
# user = "pekko-plugin"

# The username's password
# (uncomment and set the property below to match your needs)
# password = "akka-plugin"
# password = "pekko-plugin"

# hikariCP settings; see: https://github.com/brettwooldridge/HikariCP
# Slick will use an async executor with a fixed size queue of 10.000 objects
Expand Down Expand Up @@ -348,9 +348,9 @@ postgres-snapshot-store {
}
}

# the akka-persistence-query provider in use
# the pekko-persistence-query provider in use
postgres-read-journal {
class = "akka.persistence.postgres.query.PostgresReadJournalProvider"
class = "org.apache.pekko.persistence.postgres.query.PostgresReadJournalProvider"

# Absolute path to the write journal plugin configuration section.
# Read journal uses event adapters from the write plugin
Expand All @@ -369,9 +369,9 @@ postgres-read-journal {

# This setting can be used to configure usage of a shared database.
# To disable usage of a shared database, set to null or an empty string.
# This setting only has effect if akka-persistence-postgres.database-provider-fqcn is set to
# akka.persistence.postgres.db.DefaultSlickDatabaseProvider. When this setting is set to a non empty string
# then the shared database with the given name will be used. (shared databases are configured as part of akka-persistence-postgres.shared-databases)
# This setting only has effect if pekko-persistence-postgres.database-provider-fqcn is set to
# org.apache.pekko.persistence.postgres.db.DefaultSlickDatabaseProvider. When this setting is set to a non empty string
# then the shared database with the given name will be used. (shared databases are configured as part of pekko-persistence-postgres.shared-databases)
# Please note that the database will only be shared with the other journals if the use-shared-db is also set
# to the same value for these other journals.
use-shared-db = null
Expand All @@ -385,26 +385,26 @@ postgres-read-journal {
use-journal-metadata = false


# Replace with "akka.persistence.postgres.query.dao.PartitionedReadJournalDao" in order to leverage dedicated queries to
# Replace with "org.apache.pekko.persistence.postgres.query.dao.PartitionedReadJournalDao" in order to leverage dedicated queries to
# partitioned journal.
dao = "akka.persistence.postgres.query.dao.FlatReadJournalDao"
dao = "org.apache.pekko.persistence.postgres.query.dao.FlatReadJournalDao"

# Confguration for akka.persistence.postgres.tag.TagIdResolver
# Configuration for org.apache.pekko.persistence.postgres.tag.TagIdResolver
tags {
# The timeout after unused tag is removed from the TagIdResolver's cache
cacheTtl = 1 hour
}

# if true, queries will include logically deleted events
# should not be configured directly, but through property akka-persistence-postgres.logicalDelete.enable
# should not be configured directly, but through property pekko-persistence-postgres.logicalDelete.enable
# in order to keep consistent behavior over write/read sides
includeLogicallyDeleted = ${akka-persistence-postgres.logicalDeletion.enable}
includeLogicallyDeleted = ${pekko-persistence-postgres.logicalDeletion.enable}

# Settings for determining if ids (ordering column) in the journal are out of sequence.
journal-sequence-retrieval {
# The maximum number of ids that will be retrieved in each batch
batch-size = 10000
# In case a number in the sequence is missing, this is the ammount of retries that will be done to see
# In case a number in the sequence is missing, this is the amount of retries that will be done to see
# if the number is still found. Note that the time after which a number in the sequence is assumed missing is
# equal to maxTries * queryDelay
# (maxTries may not be zero)
Expand All @@ -413,7 +413,7 @@ postgres-read-journal {
query-delay = 1 second
# The maximum backoff time before trying to query again in case of database failures
max-backoff-query-delay = 1 minute
# The ask timeout to use when querying the journal sequence actor, the actor should normally repond very quickly,
# The ask timeout to use when querying the journal sequence actor, the actor should normally respond very quickly,
# since it always replies with its current internal state
ask-timeout = 1 second
}
Expand Down Expand Up @@ -459,15 +459,15 @@ postgres-read-journal {

# The JDBC URL for the chosen database
# (uncomment and set the property below to match your needs)
# url = "jdbc:postgresql://localhost:5432/akka-plugin"
# url = "jdbc:postgresql://localhost:5432/pekko-plugin"

# The database username
# (uncomment and set the property below to match your needs)
# user = "akka-plugin"
# user = "pekko-plugin"

# The username's password
# (uncomment and set the property below to match your needs)
# password = "akka-plugin"
# password = "pekko-plugin"

# hikariCP settings; see: https://github.com/brettwooldridge/HikariCP
# Slick will use an async executor with a fixed size queue of 10.000 objects
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Copyright (C) 2019 - 2020 Lightbend Inc. <https://www.lightbend.com>
*/

package akka.persistence.postgres.config
package org.apache.pekko.persistence.postgres.config

import akka.persistence.postgres.util.ConfigOps._
import org.apache.pekko.persistence.postgres.util.ConfigOps._
import com.typesafe.config.Config

import scala.concurrent.duration._
Expand Down Expand Up @@ -107,7 +107,7 @@ class TagsTableConfiguration(config: Config) {
}

class JournalPluginConfig(config: Config) {
val dao: String = config.asString("dao", "akka.persistence.postgres.journal.dao.FlatJournalDao")
val dao: String = config.asString("dao", "org.apache.pekko.persistence.postgres.journal.dao.FlatJournalDao")
override def toString: String = s"JournalPluginConfig($dao)"
}

Expand All @@ -122,12 +122,12 @@ class BaseByteArrayJournalDaoConfig(config: Config) {
}

class ReadJournalPluginConfig(config: Config) {
val dao: String = config.as[String]("dao", "akka.persistence.postgres.query.dao.FlatReadJournalDao")
val dao: String = config.as[String]("dao", "org.apache.pekko.persistence.postgres.query.dao.FlatReadJournalDao")
override def toString: String = s"ReadJournalPluginConfig($dao)"
}

class SnapshotPluginConfig(config: Config) {
val dao: String = config.as[String]("dao", "akka.persistence.postgres.snapshot.dao.ByteArraySnapshotDao")
val dao: String = config.as[String]("dao", "org.apache.pekko.persistence.postgres.snapshot.dao.ByteArraySnapshotDao")
override def toString: String = s"SnapshotPluginConfig($dao)"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package akka.persistence.postgres.db
package org.apache.pekko.persistence.postgres.db

import java.sql.SQLException

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package akka.persistence.postgres.db
package org.apache.pekko.persistence.postgres.db

import com.github.tminglei.slickpg._
import slick.basic.Capability
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Copyright (C) 2019 - 2020 Lightbend Inc. <https://www.lightbend.com>
*/

package akka.persistence.postgres.db
package org.apache.pekko.persistence.postgres.db

import akka.actor.ActorSystem
import org.apache.pekko.actor.ActorSystem
import javax.naming.InitialContext
import akka.persistence.postgres.config.SlickConfiguration
import org.apache.pekko.persistence.postgres.config.SlickConfiguration
import com.typesafe.config.Config
import slick.basic.DatabaseConfig
import slick.jdbc.JdbcProfile
Expand Down
Loading

0 comments on commit 3465c63

Please sign in to comment.