Skip to content

Releases: JaidenAshmore/java-dynamic-sqs-listener

3.0.0 Milestone 3

21 Jul 19:30
Compare
Choose a tag to compare
3.0.0 Milestone 3 Pre-release
Pre-release

This milestone contained big changes to the frameworks API to follow a non-blocking paradigm. This reduces the number of threads that are blocked while there are no messages to process. For example, if we have 2 listeners with concurrency of 30 threads each and there are no messages to process, there would be 60 threads blocked. With this approach only the threads that are being used to process messages will be around.

This also changed how the framework is shutdown by allowing for any messages that have been download and stored locally will have a chance to be processed before the application ends.

API Redesign

  • The MessageBroker has been redesigned to not need to have a background thread running to process messages. Instead it exposes methods to process methods where the container can provide how messages are retrieved and resolved.\
  • The MessageResolver got merged with the Async version because attempting to do graceful shutdowns where all messages are resolved before finishing don't work when there is no way to wait for the resolver to finish. In other words all reliable MessageResolvers needed to be Async.
  • The MessageRetriever has been made non blocking my returning a CompletableFuture for the message instead of blocking and returning the message when it is obtained. It has also been merged with the Async implementation as a non-async implementation doesn't work well with graceful shutdowns. When the retriever is shutdown it will also return any messages that have been stored internally so that they can be processed on shutdown if desired.
  • The MessageProcessor now returns a CompletableFuture for when the message has finished processing. It now also takes in a Runnable that should be called if the message has successfully been processed and should been resolved instead of requiring a dependency on the MessageResolver.
  • The MessageListenerContainer previously had the responsibility to start and stop the background which it could do all at once by stopping the ExecutorService. Now it has been made to have more responsibility with determining the order of startup and shutdown to allow for more graceful shutdowns. For example, it now has the responsibility of allowing the processing of any messages downloaded but not processed yet.

Core Changes

  • SimpleMessageListenerContainer was changed to CoreMessageListenerContainer as it isn't very simple anymore. It now handles gracefully shutting down the container so that any extra messages, e.g. messages prefetched, can be processed before shutting down.
  • RetryableMessageProcessor was removed. I don't want to maintain this and it is simple for consumers to implement this them self if they want.
  • BlockingMessageRetriever was removed. This was provided to allow for more graceful shutdowns as well as for testing. This isn't really needed anymore.
  • IndividualMessageRetriever was removed. This was originally used to show that you could just request a message when needed but I feel it wouldn't be used in production and therefore is a waste for me to maintain it. You can achieve the same by using a BatchingMessageRetriever with a batch size of 1.

Spring Changes

  • Core annotations updated to allow for the consumer to configure whether any messages downloaded but not processed should be processed on shutdown.
  • Core annotations updated to allow for the consumer to configure whether any messages currently being processed during a shutdown should be interrupted.

3.0.0 Milestone 2

27 Jun 03:30
Compare
Choose a tag to compare
3.0.0 Milestone 2 Pre-release
Pre-release

Enhancements

Tech Debt

  • [GH-125] Dependencies for the library have been bumped to latest versions. For example, Spring Boot 2.1.6.RELEASE. 8273a27
  • [GH-131] Removed java-dynamic-sqs-listener from example modules to make it easier to read. d4dad4d

3.0.0 Milestone 1

22 Jun 04:25
Compare
Choose a tag to compare
3.0.0 Milestone 1 Pre-release
Pre-release

Enhancements

2.3.0

22 Jun 03:53
Compare
Choose a tag to compare

Enhancements

  • [GH-114]: The Spring Starter was split into Spring Core and Spring Starter so that people can include the Spring code without it auto configuring via the Spring Factories. E.g. an example would be them providing their own annotation @EnableSqs which will enable the framework when it is used. 153d8c9

Bug fixes

  • [GH-119]: Fixed a problem where the shutting down of the MessageRetrievers was not being followed when the thread was interrupted during the call to get more messages from the SqsAsyncClient but before we wait on the CompletableFuture. c5d2f5e
  • [GH-112]: Spring batching queue listeners now properly distinguish between concurrency and batch rate. For example, you want 30 messages to be completed concurrently but you only want messages to be downloaded in batches of 10. Previously a concurrency of 30 would try and download a batch of 30. 346613a

Local Development Improvements

  • [GH-111]: LocalSqsAsyncClient can now name the created DLQ instead of using the format {queueName}-dlq. 7a789f4

Tech Debt

  • [GH-121]: Improved the build success rate which seemed to be failing more than 50% of the time due to the Surefire VM Fork dying. c8384c4

2.2.0

30 May 00:45
Compare
Choose a tag to compare

Enhancments

  • [GH-103]: Methods processing messages may now include the raw Message as an argument to the message when using the CoreArgumentResolver or by default in the Spring Starter. e88a0b5
public class MyListener {
   @QueueListener("queueName")
   public void myMethod(Message message) {
        // do something with the raw message
   }
}
  • [GH-87]:Methods processing messages may now include individual MessageAttributes and MessageSystemAttributes as an argument to the message when using the CoreArgumentResolver or by default in the Spring Starter. 9d66dba, d0a78d2
public class MyListener {
   @QueueListener("queueName")
   public void myMethod(@MessageAttribute("key") String attribute) {
        // do something
   }

   @QueueListener("otherQueueName")
   public void myMethod(@MessageSystemAttribute(SENT_TIMESTAMP) String systemAttribute) {
        // do something
   }
}
  • [QH-90]: Can now resolve annotation parameters using spring properties instead of having them hardcoded. f6bd8ff
@QueueListener(value = "something", concurrencyLevelString="$something.concurrencyLevel}")

and the application.yml has

something:
    concurrencyLevel: 2

Bug Fixes

  • [GH-97]: The code no longer has catch (Throwable throwable) for catching exceptions as this can catch Errors like an OutOfMemoryError. 117036d
  • [GH-91]: Stop exceptions in the background threads of the application to cause the thread to stop. For example, if one of the Properties method throws a RuntimeException the whole background thread will stop. 67b555e, 442eb34

Security Fixes

  • [GH-96]: Bumped Jackson Databind version from 2.9.8 to 2.9.9. 14c4bc9

2.1.0

18 May 23:38
Compare
Choose a tag to compare

Enhancments

  • [GH-85]: Message Processing methods can return CompletableFuture which will resolve the message if it is resolved. bdb54f6
  • [GH-87]: Able to configure the ConcurrentMessageBroker to provide customisable thread names. 9fd2c10