Skip to content

Commit 9897c93

Browse files
authored
Switch from Akka to Pekko (#25)
1 parent f91a2a3 commit 9897c93

File tree

75 files changed

+245
-249
lines changed

Some content is hidden

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

75 files changed

+245
-249
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Fleam release notes
22
-------------------
33

4+
## Fleam 8.0.0
5+
6+
* Switch from Akka to Pekko
7+
* See [Pekko migration guide](https://pekko.apache.org/docs/pekko/current/project/migration-guides.html)
8+
* Updates dependency versions
9+
* Drops Java 8 support
10+
411
## Fleam 7.1.0
512

613
* Updates dependency versions

NOTICE

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
Fleam
1+
# Fleam
22
Copyright 2020-present, Nike, Inc. (http://nike.com)
33
All rights reserved.
44
The Nike Fleam software is licensed under the Apache-2.0 license found in the LICENSE.txt file included in the root directory of the project source tree.
55

66
** Free and Open-Source Software Notices:
77
The Nike Fleam software incorporates, depends upon, interacts with, or was developed using the free and open-source software components listed below. Please see the linked component sites for additional licensing, dependency, and use information and component source code:
88

9-
* Akka Streams
10-
project homepage/download site: https://akka.io/
11-
https://github.com/akka/akka
12-
project licensing notices: https://doc.akka.io/docs/akka/snapshot/project/licenses.html
9+
* Pekko Streams
10+
project homepage/download site: https://pekko.apache.org
11+
https://github.com/apache/pekko
12+
project licensing notices: https://github.com/apache/pekko/blob/main/LICENSE
1313
/LICENSE.txt:
1414
Apache License
1515
Version 2.0, January 2004
@@ -48,20 +48,6 @@ Copyright [yyyy] [name of copyright owner]
4848
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4949
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5050
---------------
51-
Licenses for dependency projects can be found here:
52-
[http://akka.io/docs/akka/snapshot/project/licenses.html]
53-
---------------
54-
akka-protobuf contains the sources of Google protobuf 2.5.0 runtime support, moved into the source package `akka.protobuf` so as to avoid version conflicts. For license information see COPYING.protobuf
55-
56-
/COPYING.protobuf:
57-
Copyright 2008, Google Inc.
58-
All rights reserved.
59-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
60-
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
61-
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
62-
* Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
63-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
64-
Code generated by the Protocol Buffer compiler is owned by the owner of the input file used when generating it. This code is not standalone and requires a support library to be linked with it. This support library is itself covered by the above license.
6551

6652
* AWS SDK for Java
6753
project homepage/download site: https://aws.amazon.com/sdk-for-java/

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
![Fleam logo][logo]
44

55
Fleam is a library designed to help create disjunctive (Eithers) and more generally monadic streams using
6-
[Cats](https://github.com/typelevel/cats/tree/master/core/src/main/scala/cats) and [Akka
7-
Streams](https://doc.akka.io/docs/akka/2.6/stream/).
6+
[Cats](https://github.com/typelevel/cats/tree/master/core/src/main/scala/cats) and [Pekko
7+
Streams](https://pekko.apache.org/docs/pekko/current/stream/index.html).
88

99
In the disjunctive case this means that as data flows through the stream if it becomes a `Left` it will no longer be
1010
processed by the disjunctive stages and will pass through continuing further down stream.
@@ -45,7 +45,7 @@ libraryDependencies ++= Seq(
4545
* `tickingGroupedWithin` - Like a normal `groupedWithin` except will emit an empty Seq after the elapsed `within`
4646
duration even if nothing has been received.
4747
* `SerializedByKeyBidi` - a
48-
[BidiFlow](https://doc.akka.io/docs/akka/2.5.4/scala/stream/stream-graphs.html#bidirectional-flows) that limits items
48+
[BidiFlow](https://pekko.apache.org/docs/pekko/current/stream/stream-graphs.html#bidirectional-flows) that limits items
4949
by a key to serial processing. For example an items of key `A` will while have to complete processing before another
5050
item of key `A` will be processed. This helps prevent concurrent operations for a key.
5151
* `Valve` - Slows processing during failed downstream services instead of failing fast.

aws/cloudwatch/src/main/scala/com/nike/fleam/cloudwatch/CloudWatch.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.nike.fleam.cloudwatch
22

3-
import akka.stream.scaladsl.Flow
3+
import org.apache.pekko.stream.scaladsl.Flow
44
import com.nike.fleam.configuration.GroupedWithinConfiguration
55
import com.nike.fleam.logging.{Counter, Counters, MetricsLogger}
66
import software.amazon.awssdk.services.cloudwatch.CloudWatchAsyncClient
@@ -82,7 +82,7 @@ object CloudWatch {
8282
List(CloudWatch.withInstanceId(Option(EC2MetadataUtils.getInstanceId).getOrElse("missing"))),
8383
filter: T => Boolean = (_: T) => true,
8484
now: () => Instant = () => Instant.now())(metricName: String)(implicit ec: ExecutionContext)
85-
: Flow[T, T, akka.NotUsed] =
85+
: Flow[T, T, org.apache.pekko.NotUsed] =
8686
CloudWatch
8787
.metricsLogger(send = wrapRequest(awsClient.putMetricData))
8888
.logCount(filter) { new Counter[T, PutMetricDataRequest] {

aws/cloudwatch/src/test/scala/com/nike/fleam/logging/CloudwatchTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package com.nike.fleam.cloudwatch
22

33
import com.nike.fleam.configuration._
44
import com.nike.fleam.logging.{Counter, Counters}
5-
import akka.stream.scaladsl._
5+
import org.apache.pekko.stream.scaladsl._
66

77
import scala.concurrent.Promise
88
import org.scalatest.flatspec.AnyFlatSpec

aws/sqs/src/main/scala/com/nike/fleam/sqs/SqsDelete.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import com.nike.fleam.configuration._
55
import sqs.configuration._
66
import software.amazon.awssdk.services.sqs.model._
77
import software.amazon.awssdk.services.sqs.SqsAsyncClient
8-
import akka.stream.scaladsl._
8+
import org.apache.pekko.stream.scaladsl._
99
import ContainsMessage.ops._
1010
import com.nike.fawcett.sqs._
1111

@@ -113,7 +113,7 @@ class SqsDelete(
113113
* @return Flow from T to BatchResult containing AWS DeleteMessageBatchResponse and results divided into successful and failed.
114114
*/
115115
def toFlow[T: ContainsMessage](config: SqsProcessingConfiguration)(implicit ec: ExecutionContext):
116-
Flow[T, BatchResult[T], akka.NotUsed] =
116+
Flow[T, BatchResult[T], org.apache.pekko.NotUsed] =
117117
Flow[T]
118118
.via(config.groupedWithin.toFlow)
119119
.map(_.toList)

aws/sqs/src/main/scala/com/nike/fleam/sqs/SqsEnqueue.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.nike.fleam
22
package sqs
33

4-
import akka.stream.scaladsl.Flow
4+
import org.apache.pekko.stream.scaladsl.Flow
55
import software.amazon.awssdk.services.sqs.SqsAsyncClient
66
import software.amazon.awssdk.services.sqs.model._
77
import com.nike.fleam.sqs.configuration.{Default, SqsProcessingConfiguration}
@@ -69,7 +69,7 @@ class SqsEnqueue(
6969
enqueueMessage(request)
7070
}
7171
def asFlow[T: ToMessage](sqsProcessing: SqsProcessingConfiguration = Default.Sqs.enqueueConfig)
72-
(implicit ec: ExecutionContext): Flow[T, (List[T], SendMessageBatchResponse), akka.NotUsed] =
72+
(implicit ec: ExecutionContext): Flow[T, (List[T], SendMessageBatchResponse), org.apache.pekko.NotUsed] =
7373
Flow[T]
7474
.via(sqsProcessing.groupedWithin.toFlow)
7575
.mapAsync(sqsProcessing.parallelism) { ts =>

aws/sqs/src/main/scala/com/nike/fleam/sqs/SqsReduce.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.nike.fleam
22
package sqs
33

4-
import akka.stream.scaladsl.{Flow, Source}
4+
import org.apache.pekko.stream.scaladsl.{Flow, Source}
55
import sqs.configuration._
66
import com.nike.fleam.configuration._
77
import cats.{Order, Semigroup}
@@ -68,7 +68,7 @@ class SqsReduce(
6868
* @return Flow from Item to either SqsReduceError or Items that had no duplicates
6969
*/
7070
def flow[Item : Semigroup : ContainsMessage : ToMessage : Keyed[*, Either[MessageError, GroupingKey]], GroupingKey : Order]:
71-
Flow[Item, Either[SqsReduceError[Item], Item], akka.NotUsed] = {
71+
Flow[Item, Either[SqsReduceError[Item], Item], org.apache.pekko.NotUsed] = {
7272
config.grouping.toFlow[Item]
7373
.flatMapConcat { batch =>
7474

aws/sqs/src/main/scala/com/nike/fleam/sqs/SqsRetry.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package sqs
33

44
import java.time.Instant
55

6-
import akka.stream.scaladsl.Flow
6+
import org.apache.pekko.stream.scaladsl.Flow
77
import cats.data._
88
import cats.implicits._
99
import software.amazon.awssdk.services.sqs.SqsAsyncClient
@@ -46,7 +46,7 @@ object SqsRetry {
4646
val emptyAttributes = Map.empty[String, MessageAttributeValue]
4747

4848
type RetryResult[T] = Either[SqsRetryError[T], T]
49-
type RetryFlow[T] = Flow[T, RetryResult[T], akka.NotUsed]
49+
type RetryFlow[T] = Flow[T, RetryResult[T], org.apache.pekko.NotUsed]
5050

5151
implicit val messageToMessage: ToMessage[Message] = ToMessage.lift(identity)
5252

@@ -116,7 +116,7 @@ class SqsRetry(
116116
deadLetter: PartialFunction[In, Map[String, MessageAttributeValue]] = PartialFunction.empty,
117117
attributesModifier: Map[MessageSystemAttributeName, String] => Map[MessageSystemAttributeName, String] = identity,
118118
retryCountOverrides: PartialFunction[In, Int] = PartialFunction.empty)
119-
(implicit ec: ExecutionContext): Flow[In, Either[SqsRetryError[In], In], akka.NotUsed] = {
119+
(implicit ec: ExecutionContext): Flow[In, Either[SqsRetryError[In], In], org.apache.pekko.NotUsed] = {
120120

121121
sealed trait Result
122122
case class Ok(in: In) extends Result

aws/sqs/src/main/scala/com/nike/fleam/sqs/SqsSource.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package sqs
33

44
import com.nike.fleam.configuration._
55
import sqs.configuration._
6-
import akka.stream.scaladsl._
7-
import akka.stream.{KillSwitches, ThrottleMode, UniqueKillSwitch}
6+
import org.apache.pekko.stream.scaladsl._
7+
import org.apache.pekko.stream.{KillSwitches, ThrottleMode, UniqueKillSwitch}
88
import software.amazon.awssdk.services.sqs.SqsAsyncClient
99
import software.amazon.awssdk.services.sqs.model._
1010
import com.nike.fawcett.sqs._

0 commit comments

Comments
 (0)