Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Allow endpoint configuration #109

Closed
jrAtAustin opened this issue Apr 14, 2020 · 1 comment
Closed

Allow endpoint configuration #109

jrAtAustin opened this issue Apr 14, 2020 · 1 comment

Comments

@jrAtAustin
Copy link

This is not a big deal but it would be nice if you could override the AmazonSQSClient endpoint configuration like is possible with the other settings such as region. I was developing using Localstack and being able to set the endpoint in the configuration by environment would be nice. To workaround this I subclassed AmazonSQSService and overrode afterPropertiesSet().

    @Override
    void afterPropertiesSet() throws Exception {
        // Set region
        Region region = AwsClientUtil.buildRegion(config, serviceConfig)
        assert region?.isServiceSupported(SERVICE_NAME as String)

        // Create client
        client = AmazonSQSClientBuilder.standard()
                .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(LOCAL_STACK_SQS_ENDPOINT, region.name))
                .withCredentials(AwsClientUtil.buildCredentials(config, serviceConfig))
                .withClientConfiguration(AwsClientUtil.buildClientConfiguration(config, serviceConfig))
                .build()

        defaultQueueName = serviceConfig?.queue ?: ''
    }
@musketyr
Copy link
Contributor

hi, it should be possible by changing proxyPort and proxyHost settings.

grails:
    plugin:
        awssdk:
            sqs:
                proxyHost: localhost
                proxyPort: <localstack port>

let me know if it works for you.

if you are working with Grails 4 (or even older) then you can use Micronaut AWS SDK instead which already has the endpoint option.

@musketyr musketyr pinned this issue Sep 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants