diff --git a/NOTICE b/NOTICE index b7c85d5e4837d017f616a150f3bbc318ef6a3999..fa6a65505b6076778fa76e8bb6f254154964e8fc 100644 --- a/NOTICE +++ b/NOTICE @@ -284,7 +284,6 @@ The following software have components provided under the terms of this license: - io.grpc:grpc-services (from https://github.com/grpc/grpc-java) - io.grpc:grpc-stub (from https://github.com/grpc/grpc-java) - io.grpc:grpc-xds (from https://github.com/grpc/grpc-java) -- ion-java (from https://github.com/amzn/ion-java/, https://github.com/amznlabs/ion-java/) - jackson-databind (from http://github.com/FasterXML/jackson, http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson) - java-cloudant (from https://cloudant.com) - javatuples (from http://www.javatuples.org) @@ -306,6 +305,7 @@ The following software have components provided under the terms of this license: - proto-google-common-protos (from https://github.com/googleapis/api-client-staging, https://github.com/googleapis/googleapis, https://github.com/googleapis/java-iam/proto-google-common-protos, https://github.com/googleapis/sdk-platform-java) - proto-google-iam-v1 (from https://github.com/googleapis/googleapis, https://github.com/googleapis/java-iam/proto-google-iam-v1, https://github.com/googleapis/sdk-platform-java) - resilience4j (from https://github.com/resilience4j/resilience4j, https://resilience4j.readme.io, ttps://resilience4j.readme.io) +- software.amazon.ion:ion-java (from https://github.com/amzn/ion-java/) - spring-boot-starter-undertow (from <https://spring.io/projects/spring-boot>, https://spring.io/projects/spring-boot) - springdoc-openapi-common (from <https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-common>, https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-common) - springdoc-openapi-ui (from https://github.com/springdoc/springdoc-openapi, https://repo1.maven.org/maven2/org/springdoc/springdoc-openapi-ui) @@ -463,14 +463,10 @@ EPL-1.0 The following software have components provided under the terms of this license: - AspectJ Weaver (from http://www.aspectj.org, https://www.eclipse.org/aspectj/) -- JUnit Jupiter (Aggregator) (from https://junit.org/junit5/) - JUnit Jupiter API (from http://junit.org/junit5/, https://junit.org/junit5/) - JUnit Jupiter Engine (from http://junit.org/junit5/, https://junit.org/junit5/) - JUnit Jupiter Params (from http://junit.org/junit5/, https://junit.org/junit5/) -- JUnit Platform Engine API (from http://junit.org/junit5/, https://junit.org/junit5/) - JUnit Vintage Engine (from http://junit.org/junit5/, https://junit.org/junit5/) -- Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) -- Jakarta Validation API (from https://beanvalidation.org) - Jakarta WebSocket - Server API (from https://projects.eclipse.org/projects/ee4j.websocket, https://repo1.maven.org/maven2/org/jboss/spec/javax/websocket/jboss-websocket-api_1.1_spec) - Java Servlet 4.0 API - Logback Contrib :: JSON :: Classic (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-classic) @@ -512,7 +508,6 @@ GPL-2.0-only The following software have components provided under the terms of this license: - JBoss Jakarta Annotations API (from <https://github.com/jboss/jboss-jakarta-annotations-api_spec>, https://github.com/jboss/jboss-jakarta-annotations-api_spec) -- Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) - Jakarta WebSocket - Server API (from https://projects.eclipse.org/projects/ee4j.websocket, https://repo1.maven.org/maven2/org/jboss/spec/javax/websocket/jboss-websocket-api_1.1_spec) ======================================================================== @@ -539,7 +534,6 @@ GPL-3.0-only ======================================================================== The following software have components provided under the terms of this license: -- Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) - Java Servlet 4.0 API ======================================================================== @@ -680,6 +674,14 @@ The following software have components provided under the terms of this license: - Netty/Codec (from https://repo1.maven.org/maven2/io/netty/netty-codec) +======================================================================== +gpl-2.0-classpath +======================================================================== +The following software have components provided under the terms of this license: + +- Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca) +- Jakarta Validation API (from https://beanvalidation.org) + ======================================================================== public-domain ======================================================================== @@ -692,10 +694,3 @@ The following software have components provided under the terms of this license: - Undertow Core (from <https://repo1.maven.org/maven2/io/undertow/undertow-core>, https://repo1.maven.org/maven2/io/undertow/undertow-core) - Undertow WebSockets JSR356 implementations (from <https://repo1.maven.org/maven2/io/undertow/undertow-websockets-jsr>, https://repo1.maven.org/maven2/io/undertow/undertow-websockets-jsr) - XNIO API (from <http://www.jboss.org/xnio>, http://www.jboss.org/xnio) - -======================================================================== -unknown -======================================================================== -The following software have components provided under the terms of this license: - -- JUnit Jupiter (Aggregator) (from https://junit.org/junit5/) diff --git a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/NotificationRetrySQSHandler.java b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/NotificationRetrySQSHandler.java index 6aaf28899a29493cd26b26a3f33b00085509d437..20163fb57dc4ecfce97bf4056142f2e9a8386c5d 100644 --- a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/NotificationRetrySQSHandler.java +++ b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/NotificationRetrySQSHandler.java @@ -70,7 +70,8 @@ public class NotificationRetrySQSHandler { private void processNotifications() throws InterruptedException { List<Message> messages; logger.info("Running notification Retry SQS processor"); - while (true) { + boolean loopVariable = true; + while (loopVariable) { try { AmazonSQSConfig sqsConfig = new AmazonSQSConfig(region); AmazonSQS sqsClient = sqsConfig.AmazonSQS(); diff --git a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/NotificationSQSHandler.java b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/NotificationSQSHandler.java index d4e7fe89e8588fcfa709a7990d3d430f6ce5c6d3..13ed80767d8133282fdfd009c9ceee09049b9403 100644 --- a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/NotificationSQSHandler.java +++ b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/NotificationSQSHandler.java @@ -70,7 +70,8 @@ public class NotificationSQSHandler { private void processNotifications() throws InterruptedException { List<Message> messages; logger.info("Running notification SQS processor"); - while (true) { + boolean loopVariable = true; + while (loopVariable) { try { AmazonSQSConfig sqsConfig = new AmazonSQSConfig(region); AmazonSQS sqsClient = sqsConfig.AmazonSQS(); diff --git a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationQueueServiceImpl.java b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationQueueServiceImpl.java index 2c0d79d776b79015a73057f2b9dcd63879bb4e44..fe6ebfda42b93709bfb0020dad80b8b5a76e6ffb 100644 --- a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationQueueServiceImpl.java +++ b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationQueueServiceImpl.java @@ -42,6 +42,7 @@ import javax.annotation.PostConstruct; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Base64; +import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -96,7 +97,7 @@ public class NotificationQueueServiceImpl implements NotificationQueueService { return messagesByDataPartition.entrySet().parallelStream() .map(entry -> processMessagesByDataPartition(entry.getKey(), entry.getValue())) - .filter(Objects::nonNull).flatMap(list -> list.stream()).collect(Collectors.toList()); + .filter(Objects::nonNull).flatMap(Collection::stream).collect(Collectors.toList()); } catch (Exception e) { logger.error("Exception processing messages :", e); return new ArrayList<>(); diff --git a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationRetryQueueServiceImpl.java b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationRetryQueueServiceImpl.java index de55ca71ce6487d40469fbe3ebae69116d53ff0b..b45eebac00c0c180b94fbc16d1df4396af2f1c23 100644 --- a/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationRetryQueueServiceImpl.java +++ b/provider/notification-aws/src/main/java/org/opengroup/osdu/notification/provider/aws/queue/impl/NotificationRetryQueueServiceImpl.java @@ -75,18 +75,22 @@ public class NotificationRetryQueueServiceImpl implements NotificationRetryQueue @Override public List<RetryProcessResult> processNotificationMessages(List<Message> messages) { + final String dataPartitionId = "data-partition-id"; + final String subscriptionId = "subscriptionId"; + Map<String, List<Message>> messagesBySubscription = messages.stream().collect(Collectors.groupingBy( - msg -> String.join(":", msg.getMessageAttributes().get("data-partition-id").getStringValue(), msg.getMessageAttributes().get("subscriptionId").getStringValue()), + msg -> String.join(":", msg.getMessageAttributes().get(dataPartitionId).getStringValue(), msg.getMessageAttributes().get(subscriptionId).getStringValue()), HashMap::new, Collectors.toCollection(ArrayList::new))); + return messagesBySubscription.entrySet().parallelStream().map(entry -> { try { - Optional<Subscription> subscription = subscriptionRepository.getSubscriptionById(entry.getValue().get(0).getMessageAttributes().get("subscriptionId").getStringValue(), - entry.getValue().get(0).getMessageAttributes().get("data-partition-id").getStringValue()); + Optional<Subscription> subscription = subscriptionRepository.getSubscriptionById(entry.getValue().get(0).getMessageAttributes().get(subscriptionId).getStringValue(), + entry.getValue().get(0).getMessageAttributes().get(dataPartitionId).getStringValue()); if (!subscription.isPresent()) { logger.info("Subscription with id {} not found for dataPartitionId {}", - entry.getValue().get(0).getMessageAttributes().get("subscriptionId").getStringValue(), - entry.getValue().get(0).getMessageAttributes().get("data-partition-id").getStringValue()); + entry.getValue().get(0).getMessageAttributes().get(subscriptionId).getStringValue(), + entry.getValue().get(0).getMessageAttributes().get(dataPartitionId).getStringValue()); deleteDbRecords(entry.getValue()); return entry.getValue().stream().map(msg -> new RetryProcessResult(msg, NotificationResult.ACK)).collect(Collectors.toList()); }