See associated blog post here.
This project contains two modules which do exactly the same thing with different versions of the Spring Cloud AWS library.
- spring-cloud-aws
- spring-cloud-aws-legacy
Use the one that is appropriate for the version you're using. The difference between the two Spring Cloud AWS libraries is explained really well here.
- Set
spring.profiles.active=local - Run
ApporAppLegacy - App should start successfully and do nothing
- AWS Region and Credentials configured via Default Provider Chains
- Create an AWS SQS queue with the name
test-queue, or use whatever name you want and update the queue name inapp.sqs-queue-nameinsrc/main/resources/application.yml
- Run with empty
spring.profiles.active - Run
ApporAppLegacy - App should start successfully
- Should send a message to the queue; See
SendMessageOnStartup - Should receive the message from the queue; See ``
c.d.s.SendMessageOnStartup : Sending message to queueName=test-queue: Message: Message(city=Anchorage, state=AK)
o.s.c.a.m.listener.QueueMessageHandler : Searching methods to handle headers={LogicalResourceId=test-queue, ApproximateReceiveCount=1, SentTimestamp=1619297491071, ReceiptHandle=...
o.s.c.a.m.listener.QueueMessageHandler : Invoking App#handleMessage[1 args]
App : Received message: Message(city=Anchorage, state=AK)
See @SpringBootTests in the src/test/java directory of each module.