Client library for AWS SQS with support for large messages, up to 2GB. This is a Clojure wrapper for https://github.com/awslabs/amazon-sqs-java-extended-client-lib
MIT License
3
stars
0
forks
source link
Running the former sqs-utils and the SQS Extended Library with Localstack #3
To have the old sqs-utils work with Localstack, the only modification that would be necessary is to change the port where the mockup services are running to 4566
To have the official working example use the Localstack mockup services, the following modifications in the source code are necessary. Except for those, no special configuration steps were required at the Localstack side.
WATCHOUT:
Region doesn't matter, but it must be one of the actual AWS region values, used my default here.
The PathStyleAccessEnabled setting is vital for this to work with Localstack!
The S3 client needs to be constructed with specified endpoint
final AmazonS3 s3 =
AmazonS3ClientBuilder.standard()
.withPathStyleAccessEnabled(true)
.withEndpointConfiguration(new EndpointConfiguration("http://localhost:4566", "ap-northeast-1"))
.build();
The SQS client needs to be constructed in a similar way
final AmazonSQS sqsExtended =
new AmazonSQSExtendedClient(AmazonSQSClientBuilder.standard()
.withEndpointConfiguration(new EndpointConfiguration("http://localhost:4566/", "ap-northeast-1"))
.build(), extendedClientConfig);
The official working example seems not to be made for running under Java 11 (javax missing there) and the above modifications also require some more AWS classes not included in the vanilla version. For this initial proof-of-concept step, the easiest way to have all those dependencies in place was to just directly add
To have the old sqs-utils work with Localstack, the only modification that would be necessary is to change the port where the mockup services are running to 4566
project.clj
To have the official working example use the Localstack mockup services, the following modifications in the source code are necessary. Except for those, no special configuration steps were required at the Localstack side.
WATCHOUT:
The S3 client needs to be constructed with specified endpoint
The SQS client needs to be constructed in a similar way
The official working example seems not to be made for running under Java 11 (javax missing there) and the above modifications also require some more AWS classes not included in the vanilla version. For this initial proof-of-concept step, the easiest way to have all those dependencies in place was to just directly add
to the pom.xml of the amazon-sqs-java-extended-client-lib repository and (re)build it with
mvn assembly:assembly -DdescriptorId=jar-with-dependencies package
The working example then runs fine with Localstack when invoked with
java -cp "amazon-sqs-java-extended-client-lib-1.0.2-jar-with-dependencies.jar" SQSExtendedClientExample.java