diff --git a/.gitignore b/.gitignore index 394c1748e8b08..9dc1974bf9a82 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ target .settings .checkstyle *.log -dependency-reduced-pom.xml +dependency-reduced-pom.xml \ No newline at end of file diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java index e7bd2375ae8a1..c0295e3c2e17b 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConfiguration.java @@ -18,7 +18,7 @@ import java.util.Collection; -import com.amazonaws.services.sqs.AmazonSQSClient; +import com.amazonaws.services.sqs.AmazonSQS; /** * The AWS SQS component configuration properties @@ -28,7 +28,7 @@ public class SqsConfiguration { // common properties private String queueName; - private AmazonSQSClient amazonSQSClient; + private AmazonSQS amazonSQSClient; private String accessKey; private String secretKey; private String amazonSQSEndpoint; @@ -90,11 +90,11 @@ public void setDeleteAfterRead(Boolean deleteAfterRead) { this.deleteAfterRead = deleteAfterRead; } - public AmazonSQSClient getAmazonSQSClient() { + public AmazonSQS getAmazonSQSClient() { return amazonSQSClient; } - public void setAmazonSQSClient(AmazonSQSClient amazonSQSClient) { + public void setAmazonSQSClient(AmazonSQS amazonSQSClient) { this.amazonSQSClient = amazonSQSClient; } diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java index 5d5b01bc4b9af..5ed50487af68f 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsConsumer.java @@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit; import com.amazonaws.AmazonClientException; -import com.amazonaws.services.sqs.AmazonSQSClient; +import com.amazonaws.services.sqs.AmazonSQS; import com.amazonaws.services.sqs.model.ChangeMessageVisibilityRequest; import com.amazonaws.services.sqs.model.DeleteMessageRequest; import com.amazonaws.services.sqs.model.Message; @@ -208,7 +208,7 @@ protected SqsConfiguration getConfiguration() { return getEndpoint().getConfiguration(); } - protected AmazonSQSClient getClient() { + protected AmazonSQS getClient() { return getEndpoint().getClient(); } diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java index 3e117d22cfbd3..9d34001e2f3a6 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsEndpoint.java @@ -21,6 +21,7 @@ import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.services.sqs.AmazonSQSClient; +import com.amazonaws.services.sqs.AmazonSQS; import com.amazonaws.services.sqs.model.CreateQueueRequest; import com.amazonaws.services.sqs.model.CreateQueueResult; import com.amazonaws.services.sqs.model.ListQueuesResult; @@ -47,7 +48,7 @@ public class SqsEndpoint extends ScheduledPollEndpoint { private static final transient Logger LOG = LoggerFactory.getLogger(SqsEndpoint.class); - private AmazonSQSClient client; + private AmazonSQS client; private String queueUrl; private SqsConfiguration configuration; private int maxMessagesPerPoll; @@ -94,7 +95,7 @@ protected void doStart() throws Exception { } } - private void createQueue(AmazonSQSClient client) { + 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 @@ -122,7 +123,7 @@ private void createQueue(AmazonSQSClient client) { LOG.trace("Queue created and available at: {}", queueUrl); } - private void updateQueueAttributes(AmazonSQSClient client) { + private void updateQueueAttributes(AmazonSQS client) { SetQueueAttributesRequest request = new SetQueueAttributesRequest(); request.setQueueUrl(queueUrl); if (getConfiguration().getDefaultVisibilityTimeout() != null) { @@ -177,14 +178,14 @@ public void setConfiguration(SqsConfiguration configuration) { this.configuration = configuration; } - public AmazonSQSClient getClient() { + public AmazonSQS getClient() { if (client == null) { client = createClient(); } return client; } - public void setClient(AmazonSQSClient client) { + public void setClient(AmazonSQS client) { this.client = client; } diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java index 0cfd25b14e104..d67ce29b99b4c 100644 --- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java +++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java @@ -16,7 +16,7 @@ */ package org.apache.camel.component.aws.sqs; -import com.amazonaws.services.sqs.AmazonSQSClient; +import com.amazonaws.services.sqs.AmazonSQS; import com.amazonaws.services.sqs.model.SendMessageRequest; import com.amazonaws.services.sqs.model.SendMessageResult; @@ -59,7 +59,7 @@ public void process(Exchange exchange) throws Exception { private void addDelay(SendMessageRequest request, Exchange exchange) { Integer headerValue = exchange.getIn().getHeader(SqsConstants.DELAY_HEADER, Integer.class); - Integer delayValue = Integer.valueOf(0); + Integer delayValue; if (headerValue == null) { LOG.trace("Using the config delay"); delayValue = getEndpoint().getConfiguration().getDelaySeconds(); @@ -81,7 +81,7 @@ private Message getMessageForResponse(Exchange exchange) { return exchange.getIn(); } - protected AmazonSQSClient getClient() { + protected AmazonSQS getClient() { return getEndpoint().getClient(); }