Examples of CreateQueueRequest


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

    private void createQueue(AmazonSQSClient client) {
        LOG.trace("Queue '{}' doesn't exist. Will create it...", configuration.getQueueName());

        // creates a new queue, or returns the URL of an existing one
        CreateQueueRequest request = new CreateQueueRequest(configuration.getQueueName());
        if (getConfiguration().getDefaultVisibilityTimeout() != null) {
            request.getAttributes().put(QueueAttributeName.VisibilityTimeout.name(), String.valueOf(getConfiguration().getDefaultVisibilityTimeout()));
        }
        if (getConfiguration().getMaximumMessageSize() != null) {
            request.getAttributes().put(QueueAttributeName.MaximumMessageSize.name(), String.valueOf(getConfiguration().getMaximumMessageSize()));
        }
        if (getConfiguration().getMessageRetentionPeriod() != null) {
            request.getAttributes().put(QueueAttributeName.MessageRetentionPeriod.name(), String.valueOf(getConfiguration().getMessageRetentionPeriod()));
        }
        if (getConfiguration().getPolicy() != null) {
            request.getAttributes().put(QueueAttributeName.Policy.name(), String.valueOf(getConfiguration().getPolicy()));
        }       
        LOG.trace("Creating queue [{}] with request [{}]...", configuration.getQueueName(), request);
       
        CreateQueueResult queueResult = client.createQueue(request);
        queueUrl = queueResult.getQueueUrl();
View Full Code Here

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

    private void setupQueueAndTopic() {
        String randomSeed = UUID.randomUUID().toString();
        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(
View Full Code Here

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

        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

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

    private Queue obtainTestQueue() {
        AmazonSQS sqsClient = createDefaultSQSClient();
        SQS sqs = new SQS(sqsClient);

        if (!queueCreated) {
            sqsClient.createQueue(new CreateQueueRequest(TEST_QUEUE));
            queueCreated = true;
        }

        return sqs.getQueueByName(TEST_QUEUE);
    }
View Full Code Here

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

    private void createQueue(AmazonSQSClient client) {
        LOG.trace("Queue '{}' doesn't exist. Will create it...", configuration.getQueueName());

        // creates a new queue, or returns the URL of an existing one
        CreateQueueRequest request = new CreateQueueRequest(configuration.getQueueName());
        if (getConfiguration().getDefaultVisibilityTimeout() != null) {
            request.getAttributes().put(QueueAttributeName.VisibilityTimeout.name(), String.valueOf(getConfiguration().getDefaultVisibilityTimeout()));
        }
        if (getConfiguration().getMaximumMessageSize() != null) {
            request.getAttributes().put(QueueAttributeName.MaximumMessageSize.name(), String.valueOf(getConfiguration().getMaximumMessageSize()));
        }
        if (getConfiguration().getMessageRetentionPeriod() != null) {
            request.getAttributes().put(QueueAttributeName.MessageRetentionPeriod.name(), String.valueOf(getConfiguration().getMessageRetentionPeriod()));
        }
        if (getConfiguration().getPolicy() != null) {
            request.getAttributes().put(QueueAttributeName.Policy.name(), String.valueOf(getConfiguration().getPolicy()));
        }       
        LOG.trace("Creating queue [{}] with request [{}]...", configuration.getQueueName(), request);
       
        CreateQueueResult queueResult = client.createQueue(request);
        queueUrl = queueResult.getQueueUrl();
View Full Code Here

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

    private void setupQueueAndTopic() {
      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(
View Full Code Here

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

        queueUrl = qUrl;
        break;
      }
    }
    if (queueUrl == null) {
      CreateQueueRequest request = new CreateQueueRequest(queueName);
      Map<String, String> queueAttributes = new HashMap<String, String>();
      queueAttributes.put("ReceiveMessageWaitTimeSeconds", Integer
          .valueOf(receiveMessageWaitTimeout).toString());
      if (messageDelay != null) {
        queueAttributes.put("DelaySeconds", messageDelay.toString());
      }
      if (maximumMessageSize != null) {
        queueAttributes.put("MaximumMessageSize",
            maximumMessageSize.toString());
      }
      if (messageRetentionPeriod != null) {
        queueAttributes.put("MessageRetentionPeriod",
            messageRetentionPeriod.toString());
      }
      if (visibilityTimeout != null) {
        queueAttributes.put("VisibilityTimeout",
            visibilityTimeout.toString());
      }
      request.setAttributes(queueAttributes);
      CreateQueueResult result = sqsClient.createQueue(request);
      queueUrl = result.getQueueUrl();
      log.debug("New queue available at: " + queueUrl);
    } else {
      log.debug("Queue already exists: " + queueUrl);
View Full Code Here

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

  }

  private String create(String name) {
    String u = endpoint.concat("/").concat(name);
    try {
      u = sqs.createQueue(new CreateQueueRequest(name)).getQueueUrl();
    } catch (AmazonServiceException ase) {
      logException(ase);
    } catch (AmazonClientException ace) {
      logger.error("Could not reach SQS. {0}", ace.toString());
    }
View Full Code Here

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

    private void setupQueueAndTopic() {
        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(
View Full Code Here

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

    private void createQueue(AmazonSQS client) {
        LOG.trace("Queue '{}' doesn't exist. Will create it...", configuration.getQueueName());

        // creates a new queue, or returns the URL of an existing one
        CreateQueueRequest request = new CreateQueueRequest(configuration.getQueueName());
        if (getConfiguration().getDefaultVisibilityTimeout() != null) {
            request.getAttributes().put(QueueAttributeName.VisibilityTimeout.name(), String.valueOf(getConfiguration().getDefaultVisibilityTimeout()));
        }
        if (getConfiguration().getMaximumMessageSize() != null) {
            request.getAttributes().put(QueueAttributeName.MaximumMessageSize.name(), String.valueOf(getConfiguration().getMaximumMessageSize()));
        }
        if (getConfiguration().getMessageRetentionPeriod() != null) {
            request.getAttributes().put(QueueAttributeName.MessageRetentionPeriod.name(), String.valueOf(getConfiguration().getMessageRetentionPeriod()));
        }
        if (getConfiguration().getPolicy() != null) {
            request.getAttributes().put(QueueAttributeName.Policy.name(), String.valueOf(getConfiguration().getPolicy()));
        }
        if (getConfiguration().getReceiveMessageWaitTimeSeconds() != null) {
            request.getAttributes().put(QueueAttributeName.ReceiveMessageWaitTimeSeconds.name(), String.valueOf(getConfiguration().getReceiveMessageWaitTimeSeconds()));
        }
        LOG.trace("Creating queue [{}] with request [{}]...", configuration.getQueueName(), request);
       
        CreateQueueResult queueResult = client.createQueue(request);
        queueUrl = queueResult.getQueueUrl();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.