-
Notifications
You must be signed in to change notification settings - Fork 33
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
Guide: Connect a Micronaut JMS Application to an AWS SQS Queue #1160
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great, only minor changes needed
guides/micronaut-jms-aws-sqs/groovy/src/main/groovy/example/micronaut/Application.groovy
Outdated
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/java/src/main/java/example/micronaut/DemoProducer.java
Outdated
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/groovy/src/main/groovy/example/micronaut/DemoConsumer.groovy
Outdated
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/kotlin/src/main/kotlin/example/micronaut/SqsClientFactory.kt
Outdated
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/kotlin/src/main/kotlin/example/micronaut/SqsClientFactory.kt
Outdated
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/java/src/main/java/example/micronaut/DemoConsumer.java
Outdated
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/groovy/src/main/groovy/example/micronaut/DemoConsumer.groovy
Outdated
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/kotlin/src/main/kotlin/example/micronaut/DemoProducer.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This guide is using AWS SDK v1's com.amazonaws.services.sqs.AmazonSQS
. It should also (or only) demonstrate how to use v2's software.amazon.awssdk.services.sqs.SqsClient
, which is preconfigured by our micronaut-aws-sdk-v2
I think that the current SQS sub-module in micronaut-jms supports only AWS SDK v1's (https://github.com/micronaut-projects/micronaut-jms/blob/master/jms-sqs/build.gradle). My understanding is that to support SDK V2, we will have to add a new module to micronaut-jms. Probably, that should be addressed in a separate ticket. @alvarosanchez please take a look and let me know if I overlooked something, and if there is a way to work around the version restriction in the micronaut-jms module. |
This is so funny, because a random guy already noticed that some time ago: micronaut-projects/micronaut-jms#35 😅 |
Max supported Java version by AWS SDK 1.x is 16 (https://github.com/aws/aws-sdk-java#maintenance-and-support-for-java-versions)
Do you guys think it is still worth finishing this guide (JMS AWS SDK v1.x integration)? When support for SDK v2 is added to micronaut-jms, we could provide the V2 guide. |
guides/micronaut-jms-aws-sqs/java/src/main/java/example/micronaut/SqsClientFactory.java
Outdated
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/groovy/src/test/groovy/example/micronaut/MicronautguideSpec.groovy
Outdated
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/java/src/test/java/example/micronaut/TestSqsClientFactory.java
Outdated
Show resolved
Hide resolved
Sure! Just address pending feedback, and then we can assign it to Sergio for publishing |
When I download the generated sources from the guide, I can compile them in IDE and run the app as well as the tests. However, the micronaut-guides CI build is failing because of:
Not sure what I have missed here. The missing package referred to in the compilation error above is from the Do I need to introduce this lib or reintroduce as part of the new feature in the 'buildSrc/src/main/java/io/micronaut/guides/feature' ? |
That pom.xml is only for having automatically upgradeable dependency versions, but it alone won't make it part of the generated build |
Have an additional question regarding the micronaut-guides test sources compile task. Not sure why compile fails for Kotlin with the following error:
What did I overlook here? The same approach having |
@@ -26,6 +26,6 @@ public void processSelectedFeatures(FeatureContext featureContext) { | |||
@Override | |||
public void apply(GeneratorContext generatorContext) { | |||
super.apply(generatorContext); | |||
addDependency(generatorContext, "aws-java-sdk-core", Scope.TEST); | |||
addDependency(generatorContext, "aws-java-sdk-core"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, otherwise the ci build was failing with the compilation error:
Executing 'micronaut-jms-aws-sqs-maven-java' tests
Error: COMPILATION ERROR :
Error: /home/runner/work/micronaut-guides/micronaut-guides/build/code/micronaut-jms-aws-sqs/micronaut-jms-aws-sqs-maven-java/src/main/java/example/micronaut/SqsClientFactory.java:[3,29] package com.amazonaws.regions does not exist
Error: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project micronautguide: Compilation failure
Error: /home/runner/work/micronaut-guides/micronaut-guides/build/code/micronaut-jms-aws-sqs/micronaut-jms-aws-sqs-maven-java/src/main/java/example/micronaut/SqsClientFactory.java:[3,29] package com.amazonaws.regions does not exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be necessary. This will add local stack to the main classpath.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, It does not add the localstack dependency to the main classpath, it just changes the scope of the aws-java-sdk-core
dependency. There are no issues when the demo source is generated and imported to IDE.
However, when I revert the change, the problem occurs during the micronut-guide project build. Tests cannot be compiled because aws-java-sdk-core
artifacts are missing.
@sdelamo what do you suggest?
@sbodvanski please click on "Resolve conversation" for the feedback items that you already addressed, otherwise it's impossible for reviewers to tell what is done and what is still pending |
Will do. Thank you for pointing it out. |
"authors": ["Slavko Bodvanski"], | ||
"tags": ["jms", "messaging", "aws"], | ||
"categories": ["Messaging"], | ||
"maximumJavaVersion": 16, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why fix maximumJavaVersion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until we add a new module to micronaut-jms to support Java AWS SDK v2's, it seems that we are limited to Java version below 17:
https://github.com/aws/aws-sdk-java#maintenance-and-support-for-java-versions
@@ -26,6 +26,6 @@ public void processSelectedFeatures(FeatureContext featureContext) { | |||
@Override | |||
public void apply(GeneratorContext generatorContext) { | |||
super.apply(generatorContext); | |||
addDependency(generatorContext, "aws-java-sdk-core", Scope.TEST); | |||
addDependency(generatorContext, "aws-java-sdk-core"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be necessary. This will add local stack to the main classpath.
guides/micronaut-jms-aws-sqs/java/src/main/java/example/micronaut/DemoController.java
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/groovy/src/main/groovy/example/micronaut/DemoController.groovy
Outdated
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/groovy/src/test/groovy/example/micronaut/MicronautguideTest.groovy
Outdated
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/groovy/src/test/groovy/example/micronaut/MicronautguideTest.groovy
Outdated
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/java/src/test/java/example/micronaut/MicronautguideTest.java
Outdated
Show resolved
Hide resolved
guides/micronaut-jms-aws-sqs/kotlin/src/test/kotlin/example/micronaut/MicronautguideTest.kt
Outdated
Show resolved
Hide resolved
* Switch to use Serde for the S3 Event guide (#1138) * Switch to use Serde for the Discovery eureka guide (#1134) * Switch to use Serde for the Oauth client credentials auth0 guide (#1133) * Switch to use Serde for the Discovery consul guide (#1135) * Use the correct version for the micronaut-data processor with SpringBoot (#1164) We were using the version of Micronaut, which is incorrect * Guide: Connect a Micronaut JMS Application to an AWS SQS Queue (#1160) Max supported Java version by AWS SDK 1.x is 16 (https://github.com/aws/aws-sdk-java#maintenance-and-support-for-java-versions) * add AWS SQS twitter card * Remove references to postgres and use mysql consistently for guide (#1166) closes #1161 * Switch to use Serde for the Mybatis data access guide (#1139) * Switch to use Serde for the Mybatis data access guide * Remove Creator, fix Kotlin warning * Fixes missing section in trace guide (#1173) * Fixes wrong callouts to WarehouseController endpoints (#1174) * Draft guide for OCI Kubernetes * Apply suggestions from code review Co-authored-by: Bernard Horan <bernard.horan@oracle.com> * Update guides to 3.7.5 (#1179) * code review improvements add native image support * code review improvements add native image support * code review improvements * code review improvements * Build Guides with Micronaut 3.8.0 (#1157) * Build Guides with Micronaut 3.8.0 This PR runs the guides with Micronaut 3.8.0-SNAPSHOT as a pre-release check Removes the local localstack feature as this now exists in 3.8.0 * Add snapshot repo for snapshot versions of Micronaut * Look up the version for the data processor * version 3.8.0 Co-authored-by: Sergio del Amo <sergio.delamo@softamo.com> * Remove ambiguity for Kotlin (#1182) It couldn't work out which mathod to call as the closure had an implicit return value. I'm not sure why this has only recently appeared... Maybe a change to micrometer * Fix inputs for guides with a base (#1183) If we have a guide that declares a base project, ie: https://github.com/micronaut-projects/micronaut-guides/blob/dd911994e0c54c068602389dbcbe08eac8bdf045/guides/micronaut-metrics-aws/metadata.json#L2 Then we were not taking the code from micronaut-metrics into account for the cache-key, so changes were not picked up when building micronaut-metrics-aws This change adds the base directory as an input if it was set * remove empty constructor (#1167) * misc fixes and cleanup (#1186) * Add R2DBC guide (#965) * copy: change GraalVM version (#1187) * change publication to 2023-01-04 * fix: category should be categories * disable spring-boot-micronaut-data guide (#1185) * Micronaut Framework 3.8.1 (#1195) * Kotlin and Groovy versions of Micronaut Dependency Injection types (#1227) Close #1082 * Add K8s AWS guide * Add K8s AWS guide * Kotlin version of JAX-RS guide (#1225) Close #1221 * code review improvements * Micronaut Framework 3.8.2 (#1229) * fix java version typo (#1234) * Mock Github Server to avoid rate limiting in HTTP Client Guide (#1236) * build: Micronaut Framework 3.8.4 * X-API-KEY guide (#1237) * add api key guide twitter card * CORS guide (#1238) * docker image guide (#1239) * executable Jar guide to distribution category (#1240) - enable every language. Use distributable-base * create the http client lazyly (#1243) * add lateinit and @field callouts (#1228) * Custom constraint guide (#1244) * custom constraint * Update guides/micronaut-custom-validation-annotation/java/src/test/java/example/micronaut/ContactTest.java * twitter card * Fix curl command (#1248) When copying the curl command, each new line is executed rather than waiting for the last command. * build: Micronaut Framework 3.8.5(#1249) * Guide: Using IntelliJ IDEA to develop Micronaut applications (#1241) * 2023 copyright * Micronaut Framework 3.8.6 (#1251) * build: Micronaut Framework 3.8.7 (#1252) * add awaitility version (#1253) Close: #1074 * Fixes for MN Scope Types guide, mostly imports and annotations to ensure that the Tests work as intended. (#1254) * [Error-handling Guide] Added missing dependency and a closing bracket for the BookController class. (#1260) * Micronaut Framework 3.8.8 (#1261) * move create your first graalvm guide to distribution category (#1256) * Security Session Guide: Removed the extra dependency that could cause tests to fail (#1263) * CRaC Cloud Run guide (#1259) Close #1257 * Keycloak Guide (#586) * add back common-google-cloud-platform.adoc snippet accidentally deleted via #1259 * add image back * use categories * Micronaut Framework 3.8.9 (#1264) * [Database JDBC Guides for AWS, Azure, and GCP] Fixed the environment variable names to be compatible with the sample JDBC application, and added explanations similar to the original JDBC guide. (#1270) * build: Micronaut Framework 3.9.1 (#1267) * build: Micronaut Build Plugin to 5.4.9 (#1273) * 3.9.2 (#1280) --------- Co-authored-by: Tim Yates <tim.yates@gmail.com> Co-authored-by: Slavko <bodvanski.slavko@gmail.com> Co-authored-by: sdelamo <sergio.delamo@softamo.com> Co-authored-by: Dean Wette <wetted@objectcomputing.com> Co-authored-by: Bernard Horan <bernard.horan@oracle.com> Co-authored-by: Burt Beckwith <burt@burtbeckwith.com> Co-authored-by: Graeme Rocher <graeme.rocher@gmail.com> Co-authored-by: Alina Yurenko <alina.yurenko@oracle.com> Co-authored-by: hartraft <hartraft@tutanota.com> Co-authored-by: Long Pham <ptlitmipitu@gmail.com>
…naut-projects#1160) Max supported Java version by AWS SDK 1.x is 16 (https://github.com/aws/aws-sdk-java#maintenance-and-support-for-java-versions)
No description provided.