[nifi] branch main updated (342fb0d876 -> 9228036e1d)
This is an automated email from the ASF dual-hosted git repository. joewitt pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/nifi.git from 342fb0d876 NIFI-12143: This closes #7820. Introduced a new nifi-calcite-utils module and refactored the nifi-sql-reporting-tasks to mamke use of it. This uses the newer calcite api instead of deprecated classes/methods - Refactored QueryRecord / JoinEnrichment to use new nifi-calcite-utils new 9b9dd4bae3 NIFI-6721: This closes #7789. jms_expiration attribute problem fix new 9228036e1d NIFI-7355: This closes #7677. TinkerpopClientService The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../src/main/resources/META-INF/NOTICE | 8 +- .../nifi-other-graph-services/pom.xml | 32 +- .../nifi/graph/AbstractTinkerpopClientService.java | 116 - .../apache/nifi/graph/GremlinClientService.java| 107 - .../apache/nifi/graph/TinkerpopClientService.java | 526 + .../org/apache/nifi/graph/gremlin/SimpleEntry.java | 31 +- .../org.apache.nifi.controller.ControllerService | 2 +- .../additionalDetails.html | 54 --- .../additionalDetails.html | 93 ... GremlinClientServiceControllerSettingsIT.java} | 14 +- ...mlinClientServiceYamlSettingsAndBytecodeIT.java | 133 ++ .../nifi/graph/TestableGremlinClientService.java | 8 +- .../src/test/resources/gremlin.yml | 5 +- .../apache/nifi/jms/processors/JMSPublisher.java | 23 +- .../org/apache/nifi/jms/processors/PublishJMS.java | 2 +- .../jms/processors/JMSPublisherConsumerIT.java | 36 ++ 16 files changed, 881 insertions(+), 309 deletions(-) delete mode 100644 nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/src/main/java/org/apache/nifi/graph/AbstractTinkerpopClientService.java delete mode 100644 nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/src/main/java/org/apache/nifi/graph/GremlinClientService.java create mode 100644 nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/src/main/java/org/apache/nifi/graph/TinkerpopClientService.java copy nifi-commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/DecimalQueryResult.java => nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/src/main/java/org/apache/nifi/graph/gremlin/SimpleEntry.java (66%) delete mode 100644 nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/src/main/resources/docs/org.apache.nifi.graph.GremlinClientService/additionalDetails.html create mode 100644 nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/src/main/resources/docs/org.apache.nifi.graph.TinkerpopClientService/additionalDetails.html rename nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/src/test/java/org/apache/nifi/graph/{GremlinClientServiceIT.java => GremlinClientServiceControllerSettingsIT.java} (84%) create mode 100644 nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/src/test/java/org/apache/nifi/graph/GremlinClientServiceYamlSettingsAndBytecodeIT.java copy minifi/minifi-c2/minifi-c2-docker/dockerhub/DockerImage.txt => nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/src/test/resources/gremlin.yml (81%)
[nifi] 02/02: NIFI-7355: This closes #7677. TinkerpopClientService
This is an automated email from the ASF dual-hosted git repository. joewitt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi.git commit 9228036e1db4624b3a90e5a0db607d2673191c59 Author: levilentz AuthorDate: Sat Sep 23 15:20:20 2023 -0700 NIFI-7355: This closes #7677. TinkerpopClientService Signed-off-by: Joseph Witt --- .../src/main/resources/META-INF/NOTICE | 8 +- .../nifi-other-graph-services/pom.xml | 32 +- .../nifi/graph/AbstractTinkerpopClientService.java | 116 - .../apache/nifi/graph/GremlinClientService.java| 107 - .../apache/nifi/graph/TinkerpopClientService.java | 526 + .../apache/nifi/graph/gremlin/SimpleEntry.java}| 38 +- .../org.apache.nifi.controller.ControllerService | 2 +- .../additionalDetails.html | 54 --- .../additionalDetails.html | 93 ... GremlinClientServiceControllerSettingsIT.java} | 14 +- ...mlinClientServiceYamlSettingsAndBytecodeIT.java | 133 ++ .../nifi/graph/TestableGremlinClientService.java | 8 +- .../resources/gremlin.yml} | 5 +- 13 files changed, 835 insertions(+), 301 deletions(-) diff --git a/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services-nar/src/main/resources/META-INF/NOTICE index 6b3e063ae4..df05408b23 100644 --- a/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services-nar/src/main/resources/META-INF/NOTICE @@ -108,13 +108,11 @@ The following binary components are provided under the Apache Software License v (ASLv2) Exp4j Copyright 2017 - (ASLv2) Groovy 2.4.16 (http://www.groovy-lang.org) -groovy-2.4.16-indy -groovy-json-2.4.16-indy -groovy-sql-2.4.16-indy + (ASLv2) Groovy 4.0.15 (http://www.groovy-lang.org) +groovy-4.0.15 The following NOTICE information applies: Apache Groovy -Copyright 2003-2018 The Apache Software Foundation +Copyright 2003-2020 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/pom.xml b/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/pom.xml index 005b9b8919..8e28435e91 100644 --- a/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/pom.xml +++ b/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/pom.xml @@ -21,6 +21,7 @@ 3.7.0 + org.apache.nifi @@ -34,7 +35,7 @@ org.apache.nifi nifi-graph-client-service-api -${project.version} +2.0.0-SNAPSHOT provided @@ -54,7 +55,6 @@ org.apache.nifi nifi-mock -2.0.0-SNAPSHOT test @@ -90,6 +90,34 @@ gremlin-driver ${gremlin.version} + + +org.apache.groovy +groovy +${nifi.groovy.version} + + +org.apache.groovy +groovy-dateutil +${nifi.groovy.version} + + +commons-codec +commons-codec + + + +org.testcontainers +testcontainers +test + + + +org.testcontainers +junit-jupiter +test + + diff --git a/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/src/main/java/org/apache/nifi/graph/AbstractTinkerpopClientService.java b/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/src/main/java/org/apache/nifi/graph/AbstractTinkerpopClientService.java deleted file mode 100644 index f85f2f6c4d..00 --- a/nifi-nar-bundles/nifi-graph-bundle/nifi-other-graph-services/src/main/java/org/apache/nifi/graph/AbstractTinkerpopClientService.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
[nifi] 01/02: NIFI-6721: This closes #7789. jms_expiration attribute problem fix
This is an automated email from the ASF dual-hosted git repository. joewitt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi.git commit 9b9dd4bae3be28057ada9fcfeca9f8e3efb79abd Author: annanys23 AuthorDate: Fri Sep 8 16:25:55 2023 + NIFI-6721: This closes #7789. jms_expiration attribute problem fix Originally authored in part by sjyang18 Signed-off-by: Joseph Witt --- .../apache/nifi/jms/processors/JMSPublisher.java | 23 -- .../org/apache/nifi/jms/processors/PublishJMS.java | 2 +- .../jms/processors/JMSPublisherConsumerIT.java | 36 ++ 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSPublisher.java b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSPublisher.java index 67a49a9dd6..d5892f013b 100644 --- a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSPublisher.java +++ b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSPublisher.java @@ -16,6 +16,7 @@ */ package org.apache.nifi.jms.processors; +import org.apache.commons.lang3.math.NumberUtils; import org.apache.nifi.logging.ComponentLog; import org.springframework.jms.connection.CachingConnectionFactory; import org.springframework.jms.core.JmsTemplate; @@ -28,6 +29,7 @@ import javax.jms.JMSException; import javax.jms.Message; import javax.jms.Session; import javax.jms.TextMessage; +import java.time.Instant; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -79,8 +81,25 @@ class JMSPublisher extends JMSWorker { this.jmsTemplate.setDeliveryMode(Integer.parseInt(entry.getValue())); this.jmsTemplate.setExplicitQosEnabled(true); } else if (entry.getKey().equals(JmsHeaders.EXPIRATION)) { - this.jmsTemplate.setTimeToLive(Integer.parseInt(entry.getValue())); -this.jmsTemplate.setExplicitQosEnabled(true); +if(NumberUtils.isCreatable(entry.getValue())) { //ignore any non-numeric values +long expiration = Long.parseLong(entry.getValue()); +long ttl = 0L; + +// if expiration was set to a positive non-zero value, then calculate the ttl +// jmsTemplate does not have an expiration field, and can only accept a ttl value +// which is then used to set jms_expiration header +// ttl is in epoch millis +if(expiration > 0) { +ttl = expiration - Instant.now().toEpochMilli(); +if(ttl > 0) { +this.jmsTemplate.setTimeToLive(ttl); + this.jmsTemplate.setExplicitQosEnabled(true); +} // else, use default ttl +} else if (expiration == 0) { // expiration == 0 means no expiration in jms +this.jmsTemplate.setTimeToLive(0); //ttl must be explicitly set to 0 to indicate no expiration +this.jmsTemplate.setExplicitQosEnabled(true); +} // else, use default ttl +} } else if (entry.getKey().equals(JmsHeaders.PRIORITY)) { this.jmsTemplate.setPriority(Integer.parseInt(entry.getValue())); this.jmsTemplate.setExplicitQosEnabled(true); diff --git a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/PublishJMS.java b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/PublishJMS.java index 8fea7dd663..1e37f6aea1 100644 --- a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/PublishJMS.java +++ b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/PublishJMS.java @@ -85,7 +85,7 @@ import static org.apache.nifi.jms.processors.ioconcept.reader.record.ProvenanceE + "FlowFile attributes will be added as JMS headers and/or properties to the outgoing JMS message.") @ReadsAttributes({ @ReadsAttribute(attribute = JmsHeaders.DELIVERY_MODE, description = "This attribute becomes the JMSDeliveryMode message header. Must be an integer."), -@ReadsAttribute(attribute = JmsHeaders.EXPIRATION, description = "This attribute becomes the JMSExpiration message header. Must be an integer."), +@ReadsAttribute(attribute = JmsHeaders.EXPIRATION, description =