有没有办法在通过代理连接时使用 aws 客户端配置信息配置 spring 云 aws

is there a way to configure spring cloud aws with aws clientconfiguration information when connecting through proxy

有没有办法在通过代理连接的 com.amazonaws.ClientConfiguration 上设置可选的代理详细信息, 在 spring-cloud-aws-autoconfigure 中与 spring-cloud-aws-version 1.0.0.RELEASEspring-boot-version 1.2.2.RELEASE 一起开发。我希望能够按如下方式配置代理详细信息

setProxyHost(java.lang.String proxyHost)
setProxyPassword(java.lang.String proxyPassword)
setProxyPort(int proxyPort)
setProxyUsername(java.lang.String proxyUsername)

cloud.aws.credentials.accessKey 和 cloud.aws.credentials.secretKey 设置在 application.properties

此问题已在 GitHub issue 中得到回答。

总结:目前无法指定自定义客户端配置。相反,必须配置和提供自定义客户端。这可以通过 java 配置以及 XML:

来完成
@Bean
public SimpleMessageListenerContainerFactory simpleMessageListenerContainerFactory() {
    SimpleMessageListenerContainerFactory factory = new SimpleMessageListenerContainerFactory();        
    factory.setAmazonSqs(customAmazonClient);

    return factory;
}

@Bean
public QueueMessageHandlerFactory queueMessageHandlerFactory() {
    QueueMessageHandlerFactory factory = new QueueMessageHandlerFactory();
    factory.setAmazonSqs(customAmazonClient);

    return factory;
} 

或XML:

<aws-messaging:annotation-driven-queue-listener amazon-sqs="customAmazonClient" send-to-message-template="messageTemplateThatUsers CustomAmazonClient" />