Package com.amazonaws.services.sqs.model

Examples of com.amazonaws.services.sqs.model.GetQueueAttributesRequest


        String queueName = "glacier-archive-transfer-" + randomSeed;
        String topicName = "glacier-archive-transfer-" + randomSeed;

        queueUrl = sqs.createQueue(new CreateQueueRequest(queueName)).getQueueUrl();
        topicArn = sns.createTopic(new CreateTopicRequest(topicName)).getTopicArn();
        String queueARN = sqs.getQueueAttributes(new GetQueueAttributesRequest(queueUrl).withAttributeNames("QueueArn")).getAttributes().get("QueueArn");

        Policy sqsPolicy =
            new Policy().withStatements(
                    new Statement(Effect.Allow)
                    .withPrincipals(Principal.AllUsers)
View Full Code Here


        verifyNumberOfMessages(sqsService, queues);

    }

    private void showAttributes(AmazonSQS sqsService, List<String> queues) {
        GetQueueAttributesRequest request = new GetQueueAttributesRequest();

        // we want all the attributes of the queue
        request = request.withAttributeNames("All");

        for (String queueURL : queues) {
            // set the queue URL, which identifies the queue
            request = request.withQueueUrl(queueURL);

            // make the request to the service
            Map<String, String> attributes = sqsService.getQueueAttributes(request).getAttributes();
           
            System.out.println("attributes of queue " + queueURL + ": " + attributes);
View Full Code Here

    }

    private void verifyNumberOfMessages(AmazonSQS sqsService,
            List<String> queues) {
        // get the attribute ApproximateNumberOfMessages for this queue
        GetQueueAttributesRequest request = new GetQueueAttributesRequest();
        request = request.withAttributeNames("ApproximateNumberOfMessages");
       
        int max = 25;

        for (String queueURL : queues) {
            request = request.withQueueUrl(queueURL);

            Map<String, String> attrs = sqsService.getQueueAttributes(request).getAttributes();

            // get the approximate number of messages in the queue
            int messages = Integer.parseInt(attrs.get("ApproximateNumberOfMessages"));
View Full Code Here

        // get all the attributes of the queue
        List<String> attributeNames = new ArrayList<String>();
        attributeNames.add("All");

        // list the attributes of the queue we are interested in
        GetQueueAttributesRequest request = new GetQueueAttributesRequest(
                Constants.QUEUE_URL);
        request.setAttributeNames(attributeNames);
        Map<String, String> attributes = sqs.getQueueAttributes(request)
                .getAttributes();
        int messages = Integer.parseInt(attributes
                .get("ApproximateNumberOfMessages"));
        int messagesNotVisible = Integer.parseInt(attributes
View Full Code Here

      String queueName = "glacier-archive-transfer-" + System.currentTimeMillis();
      String topicName = "glacier-archive-transfer-" + System.currentTimeMillis();

        queueUrl = sqs.createQueue(new CreateQueueRequest(queueName)).getQueueUrl();
        topicArn = sns.createTopic(new CreateTopicRequest(topicName)).getTopicArn();
        String queueARN = sqs.getQueueAttributes(new GetQueueAttributesRequest(queueUrl).withAttributeNames("QueueArn")).getAttributes().get("QueueArn");

        Policy sqsPolicy =
            new Policy().withStatements(
                    new Statement(Effect.Allow)
                    .withPrincipals(Principal.AllUsers)
View Full Code Here

    resolveQueueArn();
  }

  private void resolveQueueArn() {
    GetQueueAttributesRequest request = new GetQueueAttributesRequest(
        queueUrl);
    GetQueueAttributesResult result = sqsClient.getQueueAttributes(request
        .withAttributeNames(Collections.singletonList(QUEUE_ARN_KEY)));
    queueArn = result.getAttributes().get(QUEUE_ARN_KEY);
  }
View Full Code Here

  public void addSnsPublishPolicy(String topicName, String topicArn) {

    String publishPolicyKey = String.format("SNS-%s-SQS-%s", topicName,
        queueName);
    String policyId = null;
    GetQueueAttributesRequest getAttrRequest = new GetQueueAttributesRequest(
        queueUrl);
    getAttrRequest.setAttributeNames(Collections.singletonList("Policy"));
    GetQueueAttributesResult result = sqsClient
        .getQueueAttributes(getAttrRequest);
    Map<String, String> attributes = result.getAttributes();
    String policyStr = attributes.get("Policy");
    log.debug("Policy:" + policyStr);
View Full Code Here

        String queueName = "glacier-archive-transfer-" + System.currentTimeMillis();
        String topicName = "glacier-archive-transfer-" + System.currentTimeMillis();

        queueUrl = sqs.createQueue(new CreateQueueRequest(queueName)).getQueueUrl();
        topicArn = sns.createTopic(new CreateTopicRequest(topicName)).getTopicArn();
        String queueARN = sqs.getQueueAttributes(new GetQueueAttributesRequest(queueUrl).withAttributeNames("QueueArn")).getAttributes().get("QueueArn");

        Policy sqsPolicy =
            new Policy().withStatements(
                    new Statement(Effect.Allow)
                    .withPrincipals(Principal.AllUsers)
View Full Code Here

                return;
        }

        synchronized (taskSpawnSyncPoint) {
            if (visibilityTimeoutNanos == -1) {
                GetQueueAttributesRequest request = new GetQueueAttributesRequest().
                        withQueueUrl(qUrl).
                        withAttributeNames("VisibilityTimeout");
                ResultConverter.appendUserAgent(request, AmazonSQSBufferedAsyncClient.USER_AGENT);
                long visibilityTimeoutSeconds = Long.parseLong(sqsClient.getQueueAttributes( request ).getAttributes().get("VisibilityTimeout"));
                visibilityTimeoutNanos = TimeUnit.NANOSECONDS.convert(visibilityTimeoutSeconds, TimeUnit.SECONDS);
View Full Code Here

                return;
        }

        synchronized (taskSpawnSyncPoint) {
            if (visibilityTimeoutNanos == -1) {
                GetQueueAttributesRequest request = new GetQueueAttributesRequest().
                        withQueueUrl(qUrl).
                        withAttributeNames("VisibilityTimeout");
                ResultConverter.appendUserAgent(request, AmazonSQSBufferedAsyncClient.USER_AGENT);
                long visibilityTimeoutSeconds = Long.parseLong(sqsClient.getQueueAttributes( request ).getAttributes().get("VisibilityTimeout"));
                visibilityTimeoutNanos = TimeUnit.NANOSECONDS.convert(visibilityTimeoutSeconds, TimeUnit.SECONDS);
View Full Code Here

TOP

Related Classes of com.amazonaws.services.sqs.model.GetQueueAttributesRequest

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.