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

Version 7.0.2 collides with AWS SQS SDK 2.25.14 #3158

Open
jsarrelli opened this issue Mar 22, 2024 · 1 comment
Open

Version 7.0.2 collides with AWS SQS SDK 2.25.14 #3158

jsarrelli opened this issue Mar 22, 2024 · 1 comment

Comments

@jsarrelli
Copy link

Hi guys,

I've realized there is an issue when the AWS SQS SDK on version "2.25.14" is present on the classpath, with version "2.20.69" it works just fine.
I have a local SQS on a Docker container, which is why I am pointing to http://locahost:9324 and a queue called "awsSnapshot"

libraryDependencies +=  "software.amazon.awssdk" % "sqs" % "2.25.14",

val AkkaVersion = "2.9.0"
val AkkaHttpVersion = "10.6.0"
libraryDependencies ++= Seq(
  "com.lightbend.akka" %% "akka-stream-alpakka-sqs" % "7.0.2",
  "com.typesafe.akka" %% "akka-stream" % AkkaVersion,
  "com.typesafe.akka" %% "akka-http" % AkkaHttpVersion
)

This code only tries to fetch the messages from the queue

object AlpakkaTests extends App {
  implicit val system: ActorSystem = ActorSystem("test")

  val logger = LoggerFactory.getLogger(this.getClass)

  implicit val sqsClient = SqsAsyncClient
    .builder
    .credentialsProvider(DefaultCredentialsProvider.create())
    .region(Region.US_EAST_1)
    .endpointOverride(URI.create("http://localhost:9324"))
    .httpClient(AkkaHttpClient.builder.withActorSystem(system).build)
    .build

  system.registerOnTermination(() => sqsClient.close())

  val sqsSource = SqsSourceSettings.create.withCloseOnEmptyReceive(true).withWaitTime(Duration.ofMillis(10))

  SqsSource("http://locahost:9324/queue/awsSnapshot", sqsSource)(sqsClient).runWith(Sink.seq[Message])
    .map(messages => logger.info(s"Got ${messages.size} messages"))
    .recover {
      case ex => logger.error("Boom", ex)
    }
}

With version "2.25.14" I got an error saying

software.amazon.awssdk.services.sqs.model.SqsException: Service returned HTTP status code 404 (Service: Sqs, Status Code: 404, Request ID: null)

Screenshot 2024-03-22 at 18 43 51

But with version "2.20.69" everything works fine

Screenshot 2024-03-22 at 18 49 59
@ennru
Copy link
Member

ennru commented Mar 25, 2024

Alpakka 7.0.2 depends on the AWS SDK 2.17.295 which is quite old now but we are conservative on this.

val AwsSdk2Version = "2.17.295"

If you override the dependency to other versions the Alpakka team can not assist you. But thank you for letting us know that upgrading to the current versions might require more work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants