From 3ad09125c184bae73be4cc81685f5fbd278602ea Mon Sep 17 00:00:00 2001 From: Dmytro Melnychuk Date: Mon, 14 Mar 2022 13:44:28 +0100 Subject: [PATCH 01/11] Fix streamMessagesInternal with message attributes --- .../rewardsnetwork/pureaws/sqs/refined/RefinedSqsClient.scala | 3 ++- .../scala/com/rewardsnetwork/pureaws/sqs/SimpleSqsClient.scala | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/sqs-refined/src/main/scala/com/rewardsnetwork/pureaws/sqs/refined/RefinedSqsClient.scala b/modules/sqs-refined/src/main/scala/com/rewardsnetwork/pureaws/sqs/refined/RefinedSqsClient.scala index e8320ca..3ccab48 100644 --- a/modules/sqs-refined/src/main/scala/com/rewardsnetwork/pureaws/sqs/refined/RefinedSqsClient.scala +++ b/modules/sqs-refined/src/main/scala/com/rewardsnetwork/pureaws/sqs/refined/RefinedSqsClient.scala @@ -103,7 +103,8 @@ object RefinedSqsClient { queueUrl, settings.maxMessages.value, settings.visibilityTimeoutSeconds.value, - settings.waitTimeSeconds.value + settings.waitTimeSeconds.value, + receiveAttrs = true ) .map { m => val attributes = MessageAttributes.fromMap( diff --git a/modules/sqs/src/main/scala/com/rewardsnetwork/pureaws/sqs/SimpleSqsClient.scala b/modules/sqs/src/main/scala/com/rewardsnetwork/pureaws/sqs/SimpleSqsClient.scala index 96d141d..677686c 100644 --- a/modules/sqs/src/main/scala/com/rewardsnetwork/pureaws/sqs/SimpleSqsClient.scala +++ b/modules/sqs/src/main/scala/com/rewardsnetwork/pureaws/sqs/SimpleSqsClient.scala @@ -4,6 +4,7 @@ import cats.syntax.all._ import cats.effect._ import fs2.Stream import software.amazon.awssdk.regions.Region +import software.amazon.awssdk.services.sqs.model.QueueAttributeName.ALL import software.amazon.awssdk.services.sqs.model._ import scala.jdk.CollectionConverters._ @@ -98,7 +99,7 @@ object SimpleSqsClient { .visibilityTimeout(visibilityTimeoutSeconds) .waitTimeSeconds(waitTimeSeconds) - val reqWithMaybeAttrs = (if (receiveAttrs) req.attributeNames(QueueAttributeName.ALL) else req).build + val reqWithMaybeAttrs = (if (receiveAttrs) req.attributeNames(ALL).messageAttributeNames(ALL.toString) else req).build client .receiveMessageStream(reqWithMaybeAttrs) From a3fc293f93da601c5a12167f07ceef41fce90b67 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Wed, 30 Mar 2022 17:27:36 +0200 Subject: [PATCH 02/11] Update fs2-core, fs2-io, ... to 3.2.7 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 271f2a6..a113f11 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ val amazonV = "2.17.143" val catsV = "2.7.0" val catsEffectV = "3.3.6" -val fs2V = "3.2.5" +val fs2V = "3.2.7" val log4catsV = "1.2.0" val refinedV = "0.9.28" val collectionCompatV = "2.6.0" From fef3e951e7c5648f613f55b006bb87e5f06c0f28 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Fri, 8 Apr 2022 11:06:50 +0200 Subject: [PATCH 03/11] Update scalacheck to 1.16.0 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 271f2a6..c29fabc 100644 --- a/build.sbt +++ b/build.sbt @@ -22,7 +22,7 @@ val collectionCompat = //Test/build deps val munitV = "0.7.29" val munitCatsEffectV = "1.0.7" -val scalaCheckV = "1.15.4" +val scalaCheckV = "1.16.0" val scalaCheckEffectV = "1.0.3" val catsEffectLaws = From 66c49bea113e675996bff96a5544fa5bb03ba3c6 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Mon, 25 Apr 2022 16:37:10 +0200 Subject: [PATCH 04/11] Update sbt-tpolecat to 0.3.1 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index b76167e..4e4a22b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.22") +addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.3.1") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10") addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2") From 5f05f7e74376379478e400d516a8f32123064a3c Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Fri, 29 Apr 2022 21:37:02 +0200 Subject: [PATCH 05/11] Update scalacheck-effect-munit to 1.0.4 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 271f2a6..5d131a3 100644 --- a/build.sbt +++ b/build.sbt @@ -23,7 +23,7 @@ val collectionCompat = val munitV = "0.7.29" val munitCatsEffectV = "1.0.7" val scalaCheckV = "1.15.4" -val scalaCheckEffectV = "1.0.3" +val scalaCheckEffectV = "1.0.4" val catsEffectLaws = "org.typelevel" %% "cats-effect-laws" % catsEffectV % "test" From de55c76861d024003b31fc186797632bb574775e Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 10 May 2022 15:56:14 +0200 Subject: [PATCH 06/11] Update refined to 0.9.29 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 271f2a6..a64af0f 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,7 @@ val catsV = "2.7.0" val catsEffectV = "3.3.6" val fs2V = "3.2.5" val log4catsV = "1.2.0" -val refinedV = "0.9.28" +val refinedV = "0.9.29" val collectionCompatV = "2.6.0" val catsCore = "org.typelevel" %% "cats-core" % catsV From ad6f3f0e4ff7d999988722570c548abeb3e93c72 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 12 May 2022 03:37:53 +0200 Subject: [PATCH 07/11] Update s3 to 2.17.189 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 271f2a6..f11c544 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,5 @@ //Core deps -val amazonV = "2.17.143" +val amazonV = "2.17.189" val catsV = "2.7.0" val catsEffectV = "3.3.6" val fs2V = "3.2.5" From 692e83f671ca4af29e613923685043c4f3d8e9e8 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Fri, 13 May 2022 22:27:37 +0200 Subject: [PATCH 08/11] Update scalafmt-core to 3.5.3 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index ed0a98a..a66ea0f 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,3 +1,3 @@ runner.dialect = scala213 -version = "3.4.3" +version = "3.5.3" maxColumn = 120 \ No newline at end of file From 885325e3831b21f04f179c1c71624927740ca57c Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Fri, 13 May 2022 22:27:46 +0200 Subject: [PATCH 09/11] Reformat with scalafmt 3.5.3 --- .../pureaws/sqs/refined/RefinedMessage.scala | 2 +- .../pureaws/sqs/refined/RefinedSqsClient.scala | 13 +++++++++++-- .../pureaws/sqs/MessageAttributes.scala | 5 ++++- .../pureaws/sqs/SimpleSqsClient.scala | 8 ++++---- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/modules/sqs-refined/src/main/scala/com/rewardsnetwork/pureaws/sqs/refined/RefinedMessage.scala b/modules/sqs-refined/src/main/scala/com/rewardsnetwork/pureaws/sqs/refined/RefinedMessage.scala index 7f7fa61..b9c1e05 100644 --- a/modules/sqs-refined/src/main/scala/com/rewardsnetwork/pureaws/sqs/refined/RefinedMessage.scala +++ b/modules/sqs-refined/src/main/scala/com/rewardsnetwork/pureaws/sqs/refined/RefinedMessage.scala @@ -14,4 +14,4 @@ final case class RefinedMessageWithAttributes[F[_]]( receiptHandle: RefinedReceiptHandle[F], attributes: MessageAttributes ) extends BaseSqsMessage[F, VisibilityTimeout] - with WithAttributes \ No newline at end of file + with WithAttributes diff --git a/modules/sqs-refined/src/main/scala/com/rewardsnetwork/pureaws/sqs/refined/RefinedSqsClient.scala b/modules/sqs-refined/src/main/scala/com/rewardsnetwork/pureaws/sqs/refined/RefinedSqsClient.scala index e8320ca..75d21da 100644 --- a/modules/sqs-refined/src/main/scala/com/rewardsnetwork/pureaws/sqs/refined/RefinedSqsClient.scala +++ b/modules/sqs-refined/src/main/scala/com/rewardsnetwork/pureaws/sqs/refined/RefinedSqsClient.scala @@ -134,13 +134,22 @@ object RefinedSqsClient { def sendMessage(queueUrl: String, messageBody: String): F[String] = simpleClient.sendMessage(queueUrl, messageBody) - def sendMessage(queueUrl: String, messageBody: String, messageAttributes: Map[String, MessageAttributeValue]): F[String] = + def sendMessage( + queueUrl: String, + messageBody: String, + messageAttributes: Map[String, MessageAttributeValue] + ): F[String] = simpleClient.sendMessage(queueUrl, messageBody, messageAttributes) def sendMessage(queueUrl: String, messageBody: String, delaySeconds: Int Refined DelaySeconds): F[String] = simpleClient.sendMessage(queueUrl, messageBody, delaySeconds.value) - def sendMessage(queueUrl: String, messageBody: String, delaySeconds: Int Refined DelaySeconds, messageAttributes: Map[String, MessageAttributeValue]): F[String] = + def sendMessage( + queueUrl: String, + messageBody: String, + delaySeconds: Int Refined DelaySeconds, + messageAttributes: Map[String, MessageAttributeValue] + ): F[String] = simpleClient.sendMessage(queueUrl, messageBody, delaySeconds.value, messageAttributes) } diff --git a/modules/sqs/src/main/scala/com/rewardsnetwork/pureaws/sqs/MessageAttributes.scala b/modules/sqs/src/main/scala/com/rewardsnetwork/pureaws/sqs/MessageAttributes.scala index f2eb432..d4cfda3 100644 --- a/modules/sqs/src/main/scala/com/rewardsnetwork/pureaws/sqs/MessageAttributes.scala +++ b/modules/sqs/src/main/scala/com/rewardsnetwork/pureaws/sqs/MessageAttributes.scala @@ -15,7 +15,10 @@ final case class MessageAttributes( ) object MessageAttributes { - def fromMap(m: Map[MessageSystemAttributeName, String], other: Map[String, MessageAttributeValue]): MessageAttributes = { + def fromMap( + m: Map[MessageSystemAttributeName, String], + other: Map[String, MessageAttributeValue] + ): MessageAttributes = { import MessageSystemAttributeName._ val approxReceiveCount = m.get(APPROXIMATE_RECEIVE_COUNT).flatMap(toIntOption) val approxFirstReceiveTimestamp = m.get(APPROXIMATE_FIRST_RECEIVE_TIMESTAMP).flatMap(toLongOption) diff --git a/modules/sqs/src/main/scala/com/rewardsnetwork/pureaws/sqs/SimpleSqsClient.scala b/modules/sqs/src/main/scala/com/rewardsnetwork/pureaws/sqs/SimpleSqsClient.scala index 96d141d..5bfa9e9 100644 --- a/modules/sqs/src/main/scala/com/rewardsnetwork/pureaws/sqs/SimpleSqsClient.scala +++ b/modules/sqs/src/main/scala/com/rewardsnetwork/pureaws/sqs/SimpleSqsClient.scala @@ -60,8 +60,8 @@ trait SimpleSqsClient[F[_]] { messageAttributes: Map[String, MessageAttributeValue] ): F[String] - /** Send a message to an SQS queue. Allows specifying the seconds to delay the message (valid values - * between 0 and 900). + /** Send a message to an SQS queue. Allows specifying the seconds to delay the message (valid values between 0 and + * 900). * @return * The message ID string of the sent message. */ @@ -71,7 +71,7 @@ trait SimpleSqsClient[F[_]] { delaySeconds: Int ): F[String] - /** Send a message with attributes to an SQS queue. Allows specifying the seconds to delay the message (valid values + /** Send a message with attributes to an SQS queue. Allows specifying the seconds to delay the message (valid values * between 0 and 900). * @return * The message ID string of the sent message. @@ -180,7 +180,7 @@ object SimpleSqsClient { def sendMessage( queueUrl: String, messageBody: String, - delaySeconds: Int, + delaySeconds: Int ): F[String] = { sendMessage(queueUrl, messageBody, delaySeconds, Map.empty[String, MessageAttributeValue]) } From b4d9004df9dc80d3745208e099eb2228bba6cddc Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 14 May 2022 03:39:34 +0200 Subject: [PATCH 10/11] Update sqs to 2.17.191 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 271f2a6..1e2b083 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,5 @@ //Core deps -val amazonV = "2.17.143" +val amazonV = "2.17.191" val catsV = "2.7.0" val catsEffectV = "3.3.6" val fs2V = "3.2.5" From 0dec085cc72aa72443a7e4c01be68ae3bfcdc3bd Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 21 May 2022 10:36:51 +0200 Subject: [PATCH 11/11] Update cats-effect-laws, cats-effect-std to 3.3.12 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 271f2a6..65bb5e7 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,7 @@ //Core deps val amazonV = "2.17.143" val catsV = "2.7.0" -val catsEffectV = "3.3.6" +val catsEffectV = "3.3.12" val fs2V = "3.2.5" val log4catsV = "1.2.0" val refinedV = "0.9.28"