/** * Creates a client for accessing Amazon SNS. * * @param awsParamsDto the AWS related parameters DTO that includes optional proxy information * * @return the Amazon SNS client */ @Cacheable(DaoSpringModuleConfig.HERD_CACHE_NAME) public AmazonSNS getAmazonSNSClient(AwsParamsDto awsParamsDto) { // Construct and return a new client to invoke service methods on Amazon SNS using default credentials provider chain. return AmazonSNSClientBuilder.standard().withClientConfiguration(awsHelper.getClientConfiguration(awsParamsDto)) .withRegion(awsParamsDto.getAwsRegionName()).build(); }
/** * Creates a client for accessing Amazon SNS. * * @param awsParamsDto the AWS related parameters DTO that includes optional proxy information * * @return the Amazon SNS client */ @Cacheable(DaoSpringModuleConfig.HERD_CACHE_NAME) public AmazonSNS getAmazonSNSClient(AwsParamsDto awsParamsDto) { // Construct and return a new client to invoke service methods on Amazon SNS using default credentials provider chain. return AmazonSNSClientBuilder.standard().withClientConfiguration(awsHelper.getClientConfiguration(awsParamsDto)) .withRegion(awsParamsDto.getAwsRegionName()).build(); }
.standard() .withCredentials(awsCredentialsProvider) .withClientConfiguration(new ClientConfiguration()) .withRegion(queueArn.getRegion()) .build(),
@Override public synchronized void validate(FaultAccumulator faultAccumulator) { super.validate(faultAccumulator); faultAccumulator.checkNotNull(config_, "config"); faultAccumulator.checkNotNull(region_, "region"); faultAccumulator.checkNotNull(accountId_, "accountId"); IConfiguration snsConfig = config_.getConfiguration("org/symphonyoss/s2/fugue/aws/sns"); ClientConfiguration clientConfig = new ClientConfiguration() .withMaxConnections( snsConfig.getInt( "maxConnections", ClientConfiguration.DEFAULT_MAX_CONNECTIONS)) .withClientExecutionTimeout( snsConfig.getInt( "clientExecutionTimeout", ClientConfiguration.DEFAULT_CLIENT_EXECUTION_TIMEOUT)) .withConnectionMaxIdleMillis( snsConfig.getLong("connectionMaxIdleMillis", ClientConfiguration.DEFAULT_CONNECTION_MAX_IDLE_MILLIS)) .withConnectionTimeout( snsConfig.getInt( "connectionTimeout", ClientConfiguration.DEFAULT_CONNECTION_TIMEOUT)) ; log_.info("Starting SNSPublisherManager in " + region_ + " with " + clientConfig.getMaxConnections() + " max connections..."); snsBuilder_ .withClientConfiguration(clientConfig) ; } }