Skip to content
Snippets Groups Projects
Commit 795447e0 authored by Wyatt Nielsen's avatar Wyatt Nielsen
Browse files

Squashed commit of the following

commit f8a4b566 
Author: Wyatt Nielsen <wyatt.nielsen@parivedasolutions.com> 
Date: Mon Nov 18 2019 18:07:30 GMT-0600 (Central Standard Time) 

    Update to use new config classes for AWS resources
parent 05f19287
No related branches found
No related tags found
1 merge request!6Trusted ibm
package org.opengroup.osdu.indexerqueue.aws.api;
// TODO: rename package
import com.amazonaws.services.sqs.AmazonSQS;
import com.amazonaws.services.sqs.AmazonSQSConfig;
import com.amazonaws.services.sqs.model.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -32,7 +32,8 @@ public class IndexerQueue {
Arguments arguments = new Arguments();
log.debug(String.format("Connecting to the SQS Queue: %s", arguments.queueName));
AmazonSQS sqsClient = SQSBuilder.generateSqsClient(arguments.region);
AmazonSQSConfig sqsConfig = new AmazonSQSConfig(arguments.region);
sqsClient = sqsConfig.AmazonSQS();
log.debug(String.format("Creating a thread pool with %s threads", arguments.maxIndexThreads));
ThreadPoolExecutor executorPool = (ThreadPoolExecutor) Executors.newFixedThreadPool(arguments.maxIndexThreads);
......
......@@ -4,8 +4,8 @@ import com.amazonaws.services.sns.model.MessageAttributeValue;
import com.amazonaws.services.sns.model.PublishRequest;
import com.amazonaws.services.sns.AmazonSNS;
import org.opengroup.osdu.core.api.DpsHeaders;
import org.opengroup.osdu.core.aws.sns.AmazonSNSConfig;
import org.opengroup.osdu.core.aws.sns.PublishRequestBuilder;
import org.opengroup.osdu.core.aws.sns.SNSBuilder;
import org.opengroup.osdu.indexer.provider.interfaces.IPublisher;
import org.opengroup.osdu.indexer.util.JobStatus;
import org.springframework.beans.factory.annotation.Value;
......@@ -28,7 +28,8 @@ public class PublisherImpl implements IPublisher {
@Inject
public void init(){
snsClient = SNSBuilder.generateAmazonSNSClient(amazonSNSRegion);
AmazonSNSConfig snsConfig = new AmazonSNSConfig(amazonSNSRegion);
snsClient = snsConfig.AmazonSNS();
}
public void publishStatusChangedTagsToTopic(DpsHeaders headers, JobStatus indexerBatchStatus) throws Exception
......
......@@ -3,7 +3,7 @@ package org.opengroup.osdu.indexer.aws.util;
import com.amazonaws.services.sqs.AmazonSQS;
import com.amazonaws.services.sqs.model.SendMessageRequest;
import org.opengroup.osdu.core.api.DpsHeaders;
import org.opengroup.osdu.core.aws.sqs.SQSBuilder;
import org.opengroup.osdu.core.aws.sqs.AmazonSQSConfig;
import org.opengroup.osdu.indexer.util.IndexerQueueTaskBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
......@@ -25,7 +25,8 @@ public class IndexerQueueTaskBuilderAws extends IndexerQueueTaskBuilder {
@Inject
public void init() {
sqsClient = SQSBuilder.generateSqsClient(region);
AmazonSQSConfig sqsConfig = new AmazonSQSConfig(region);
sqsClient = sqsConfig.AmazonSQS();
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment