Package com.amazonaws.services.sqs

Examples of com.amazonaws.services.sqs.AmazonSQSClient


    @BeforeClass
    public void setupElasticMQ() {
        elasticNode = NodeBuilder.withStorage(new InMemoryStorage());
        sqsServer = new SQSRestServerBuilder(elasticNode.nativeClient(), ELASTIMQ_PORT, new NodeAddress("http", "localhost", ELASTIMQ_PORT, "")).start();

        AmazonSQSClient sqsClient = new AmazonSQSClient(new BasicAWSCredentials("1234", "1234"));
        sqsClient.setEndpoint("http://localhost:" + ELASTIMQ_PORT);
        sqsClient.createQueue(new CreateQueueRequest(TEST_QUEUE));
    }
View Full Code Here


        sqsServer = new SQSRestServerBuilder(elasticNode.nativeClient(), ELASTIMQ_PORT,
                new NodeAddress("http", "localhost", ELASTIMQ_PORT, "")).start();
    }

    private AmazonSQS createDefaultSQSClient() {
        AmazonSQSClient sqsClient = new AmazonSQSClient(new BasicAWSCredentials("1234", "1234"));
        sqsClient.setEndpoint(format("http://localhost:%s", ELASTIMQ_PORT));
        return sqsClient;
    }
View Full Code Here

     * Provide the possibility to override this method for an mock implementation
     * @return AmazonSQSClient
     */
    AmazonSQSClient createClient() {
        AWSCredentials credentials = new BasicAWSCredentials(configuration.getAccessKey(), configuration.getSecretKey());
        AmazonSQSClient client = new AmazonSQSClient(credentials);
        if (configuration.getAmazonSQSEndpoint() != null) {
            client.setEndpoint(configuration.getAmazonSQSEndpoint());
        }
        return client;
    }
View Full Code Here

        // prepare the credentials
        String accessKey = Constants.ACCESS_KEY;
        String secretKey = Constants.SECRET_KEY;

        // create the SQS service
        AmazonSQS sqsService = new AmazonSQSClient(
                    new BasicAWSCredentials(accessKey, secretKey));

        // XXX SET TO THE PREFERRED REGION
        // set the endpoint for us-east-1 region
        sqsService.setEndpoint("https://sqs.us-east-1.amazonaws.com");
       
        new SQSExamples().run(sqsService);

    }
View Full Code Here

        String secretKey = Constants.SECRET_KEY;
        AWSCredentials credentials = new BasicAWSCredentials(accessKey,
                secretKey);

        // get the SQS service
        AmazonSQS sqs = new AmazonSQSClient(credentials);
        List<String> attributes = new ArrayList<String>();
        attributes.add("All");

        SQSLogger sqsLogger = new SQSLogger(credentials);
View Full Code Here

        cloudWatch = new AmazonCloudWatchAsyncClient(new BasicAWSCredentials(keyId, keySecret));
    }
   
    private void initSqs(String keyId, String keySecret) {
        log.debug("Initializing SQS Client");
        sqs = new AmazonSQSClient(new BasicAWSCredentials(keyId, keySecret));
       
        //SQS Consistency Queue
        consistencyQueue = conf.get("s3mper.alert.sqs.queue", consistencyQueue);
        consistencyQueueUrl = sqs.getQueueUrl(new GetQueueUrlRequest(consistencyQueue)).getQueueUrl();
       
View Full Code Here

       
        //An override option for accessing across accounts
        keyId = conf.get("fs."+uri.getScheme()+".override.awsAccessKeyId", keyId);
        keySecret = conf.get("fs."+uri.getScheme()+".override.awsSecretAccessKey", keySecret);
       
        sqs = new AmazonSQSClient(new BasicAWSCredentials(keyId, keySecret));
       
        //SQS Consistency Queue
        consistencyQueue = conf.get("fs"+uri.getScheme()+".alert.sqs.queue", consistencyQueue);
        consistencyQueue = sqs.getQueueUrl(new GetQueueUrlRequest(consistencyQueue)).getQueueUrl();
       
View Full Code Here

  private String topicArn;

    private static final Log log = LogFactory.getLog(JobStatusMonitor.class);

  public JobStatusMonitor(AWSCredentialsProvider credentialsProvider, ClientConfiguration clientConfiguration) {
    sqs = new AmazonSQSClient(credentialsProvider, clientConfiguration);
    sns = new AmazonSNSClient(credentialsProvider, clientConfiguration);
    setupQueueAndTopic();
  }
View Full Code Here

    }

    if (queue == null) {
      if (sqsClient == null) {
        if (awsClientConfiguration == null) {
          sqsClient = new AmazonSQSClient(awsCredentialsProvider);
        } else {
          sqsClient = new AmazonSQSClient(awsCredentialsProvider,
              awsClientConfiguration);
        }
      }
      if (regionId != null) {
        sqsClient.setEndpoint(String.format("sqs.%s.amazonaws.com",
View Full Code Here

    private String topicArn;

    private static final Log log = LogFactory.getLog(JobStatusMonitor.class);

    public JobStatusMonitor(AWSCredentialsProvider credentialsProvider, ClientConfiguration clientConfiguration) {
        sqs = new AmazonSQSClient(credentialsProvider, clientConfiguration);
        sns = new AmazonSNSClient(credentialsProvider, clientConfiguration);
        setupQueueAndTopic();
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.sqs.AmazonSQSClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.