Example usage for com.amazonaws.services.sqs AmazonSQSClient AmazonSQSClient

List of usage examples for com.amazonaws.services.sqs AmazonSQSClient AmazonSQSClient

Introduction

In this page you can find the example usage for com.amazonaws.services.sqs AmazonSQSClient AmazonSQSClient.

Prototype

AmazonSQSClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) 

Source Link

Document

Constructs a new client to invoke service methods on Amazon SQS using the specified parameters.

Usage

From source file:io.relution.jenkins.scmsqs.factories.SQSFactoryImpl.java

License:Apache License

@Override
public AmazonSQS createSQS(final SQSQueue queue) {
    final ClientConfiguration clientConfiguration = this.getClientConfiguration(queue);
    final AmazonSQS sqs = new AmazonSQSClient(queue, clientConfiguration);

    if (queue.getEndpoint() != null) {
        sqs.setEndpoint(queue.getEndpoint());
    }/*from   w w  w  . j  av  a  2  s  . co m*/

    return sqs;
}

From source file:org.apache.nifi.processors.aws.sqs.AbstractSQSProcessor.java

License:Apache License

/**
 * Create client using credentials provider. This is the preferred way for creating clients
 *//*from  ww  w.j ava  2s  .  c o  m*/
@Override
protected AmazonSQSClient createClient(final ProcessContext context,
        final AWSCredentialsProvider credentialsProvider, final ClientConfiguration config) {
    getLogger().info("Creating client using aws credentials provider ");

    return new AmazonSQSClient(credentialsProvider, config);
}

From source file:org.apache.nifi.processors.aws.sqs.AbstractSQSProcessor.java

License:Apache License

/**
 * Create client using AWSCredentials//from w  ww .  j a va 2s.c om
 *
 * @deprecated use {@link #createClient(ProcessContext, AWSCredentialsProvider, ClientConfiguration)} instead
 */
@Override
protected AmazonSQSClient createClient(final ProcessContext context, final AWSCredentials credentials,
        final ClientConfiguration config) {
    getLogger().info("Creating client using aws credentials ");

    return new AmazonSQSClient(credentials, config);
}

From source file:org.apache.usergrid.persistence.queue.impl.SNSQueueManagerImpl.java

License:Apache License

/**
 * Create the SQS client for the specified settings
 *//*from  ww w  .j a  v  a2  s  . c om*/
private AmazonSQSClient createSQSClient(final Region region) {

    final UsergridAwsCredentialsProvider ugProvider = new UsergridAwsCredentialsProvider();
    final AmazonSQSClient sqs = new AmazonSQSClient(ugProvider.getCredentials(), clientConfiguration);

    sqs.setRegion(region);

    return sqs;
}

From source file:support.SQS.java

License:Open Source License

SQS() {

    try {//from  ww  w  . j  ava  2s. com
        credentials = new ProfileCredentialsProvider(key_path, "default").getCredentials();
    } catch (Exception e) {
        throw new AmazonClientException("Cannot load the credentials from the credential profiles file. "
                + "Please make sure that your credentials file is at the correct "
                + "location (C:\\Users\\Sayon\\.aws\\credentials), and is in valid format.", e);
    }

    ClientConfiguration clientConfiguration = new ClientConfiguration();
    //        clientConfiguration.setProxyHost(proxy_host);
    //        clientConfiguration.setProxyPort(proxy_port);
    //        clientConfiguration.setProxyUsername(proxy_username);
    //        clientConfiguration.setProxyPassword(proxy_password);
    //        
    sqs = new AmazonSQSClient(credentials, clientConfiguration);
    Region usWest2 = Region.getRegion(Regions.US_WEST_2);
    sqs.setRegion(usWest2);

}