Skip to content

7.0.0

Latest
Compare
Choose a tag to compare
@JaidenAshmore JaidenAshmore released this 19 Oct 12:36
· 1 commit to 7.x since this release

Release with version bumps, a refactor of the spring modules and micronaut support.

Micronaut support!

Big thanks to lucjross, we have added support for micronaut

Usage

  1. Include the Micronaut core dependency with Maven <dependencies>:

    <dependency>
        <groupId>com.jashmore</groupId>
        <artifactId>java-dynamic-sqs-listener-micronaut-core</artifactId>
        <version>${sqs.listener.version}</version>
    </dependency>

    Or with Gradle:

    dependencies {
        implementation("com.jashmore:java-dynamic-sqs-listener-micronaut-core:${sqs.listener.version}")
    }
  2. Also, include the Micronaut annotation processor with Maven:

    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.version}</version>
                <configuration>
                    <annotationProcessorPaths>
                        <annotationProcessorPath>
                            <groupId>com.jashmore</groupId>
                            <artifactId>java-dynamic-sqs-listener-micronaut-inject-java</artifactId>
                            <version>${sqs.listener.version}</version>
                        </annotationProcessorPath>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>

    Or with Gradle:

    dependencies {
        annotationProcessor("com.jashmore:java-dynamic-sqs-listener-micronaut-inject-java:${sqs.listener.version}")
    }

    Micronaut will use this at compile time to transform usages of core listener annotations to enable
    method processors to register annotated methods as message listeners.

  3. In one of your beans, attach a
    @QueueListener or other supported annotation
    to a method indicating that it should process messages from a queue.

    @Singleton
    public class MyMessageListener {
    
        // The queue here can point to your SQS server, e.g. a
        // local SQS server or one on AWS
        @QueueListener("${insert.queue.url.here}")
        public void processMessage(@Payload final String payload) {
            // process the message payload here
        }
    }

    This will use any configured SqsAsyncClient in the application context for connecting to the queue, otherwise a default
    will be provided that will look for AWS credentials/region from multiple areas, like the environment variables.

See the README.md for more details on how to configure

Version Bumps

Spring Boot 3.1.2 to 3.3.4
Jackson 2.15.2 to 2.18.0
sl4fj api 2.0.7 to 2.0.16
ktor 2.3.2 to 2.3.12

See #409

Spring API Changes

The Spring package was split up between spring-api and spring-core but when we wanted to integrate micronaut support we saw that a lot of the infrastructure for Spring is relevant to other libraries. This change pulls out a bunch of the spring common code into the root api/core packages. This would only impact users that have extended the libraries and would mostly just require some small changes to align.

The annotations for Spring have changed from import com.jashmore.sqs.spring.container.* to com.jashmore.sqs.annotations.core.* as the annotations logic has been pulled to the core library.

See #411 for more details about all of the changes.