Publishing messages to AWS SNS with Micronaut and Kotlin

678 Views Asked by At

I'm tryin to send a list of objects to an SNS topic, with Micronaut and Kotlin.

Following the documentation https://micronaut-projects.github.io/micronaut-aws/latest/guide/#sdkv2

  1. I added implementation("io.micronaut.aws:micronaut-aws-sdk-v2").
  2. accessKeyId, secretKey, sessionToken and region to the application yml file.
  3. Added implementation("software.amazon.awssdk:sns") After which you should have these beans:
  • software.amazon.awssdk.services.sns.SnsAsyncClientBuilder
  • software.amazon.awssdk.services.sns.SnsAsyncClient I'm assuming asynchronous calls...

Now it's not clear what else should I do how to create the clients to make the calls to publish a message.

I was inclined to use Netty but what about URLConnection ??
Whats the next step in here?

I've also found another article but they use Java https://agorapulse.github.io/micronaut-aws-sdk/#_simple_notification_service_sns
it uses another package

Is there any example of how to do this? can you do this with Micronaut?

0

There are 0 best solutions below