Skip to content

Instantly share code, notes, and snippets.

@rozaydin
Created January 22, 2019 07:31
Show Gist options
  • Save rozaydin/c5e41b9618370cbe72a62a2b76941d25 to your computer and use it in GitHub Desktop.
Save rozaydin/c5e41b9618370cbe72a62a2b76941d25 to your computer and use it in GitHub Desktop.
@Primary
@Bean("AwsSqs")
public AmazonSQSAsync createAWSSQSClient() {
String endpoint = "http://localhost:9324";
String region = "elasticmq";
String accessKey = "x";
String secretKey = "x";
AmazonSQSAsync client =
AmazonSQSAsyncClientBuilder.standard()
.withCredentials(
new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey)))
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, region))
.build();
String queueUrl = client.getQueueUrl("AOD-MQttDropConnQueue").getQueueUrl();
client.sendMessage(queueUrl, "mqtt-client-id");
return client;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment