From 99e6bc22c8d9e6b696f398de2a743e6873743a28 Mon Sep 17 00:00:00 2001 From: Anja Helmbrecht-Schaar Date: Wed, 30 Nov 2022 14:21:24 +0100 Subject: [PATCH] Upgrade to latest eclipse.tahu core version Set Version to new HiveMQ Version --- build.gradle.kts | 3 +-- gradle.properties | 4 ++-- src/hivemq-extension/sparkplug.properties | 2 +- .../hivemq/extensions/sparkplug/aware/utils/PayloadUtil.java | 4 ++-- .../aware/SparkplugPublishOutboundInterceptorTest.java | 2 +- .../sparkplug/aware/SparkplugSubscribeInterceptorTest.java | 2 +- .../extensions/sparkplug/aware/utils/PayloadUtilTest.java | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index fc8f368..1116dc8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,8 +27,7 @@ repositories { dependencies { - implementation( files("lib/tahu-core-0.5.15.jar")) - //implementation("org.eclipse.tahu:tahu-java:${property("tahu.version")}") + implementation("org.eclipse.tahu:tahu-core:${property("tahu.version")}") implementation("org.codehaus.jackson:jackson-mapper-asl:${property("mapper.version")}") implementation("com.fasterxml.jackson.core:jackson-core:${property("fasterxml.version")}") implementation( "com.fasterxml.jackson.core:jackson-databind:${property("fasterxml.version")}") diff --git a/gradle.properties b/gradle.properties index fad0818..84a7d65 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=4.8.2 +version=4.9.1 # commons-lang3.version=3.8.1 @@ -8,7 +8,7 @@ fasterxml.version=2.13.2 mapper.version=1.9.13 protobuf.version=3.17.3 -tahu.version=0.5.12 +tahu.version=1.0.0 # test dependencies # diff --git a/src/hivemq-extension/sparkplug.properties b/src/hivemq-extension/sparkplug.properties index 325a4c4..316bdce 100644 --- a/src/hivemq-extension/sparkplug.properties +++ b/src/hivemq-extension/sparkplug.properties @@ -7,5 +7,5 @@ sparkplug.version=spBv1.0 sparkplug.systopic=$sparkplug/certificates/ sparkplug.compression=false -sparkplug.json.log=true +sparkplug.json.log=false sparkplug.systopic.msgExpiry=4294967296 diff --git a/src/main/java/com/hivemq/extensions/sparkplug/aware/utils/PayloadUtil.java b/src/main/java/com/hivemq/extensions/sparkplug/aware/utils/PayloadUtil.java index 24ba61a..d944f58 100644 --- a/src/main/java/com/hivemq/extensions/sparkplug/aware/utils/PayloadUtil.java +++ b/src/main/java/com/hivemq/extensions/sparkplug/aware/utils/PayloadUtil.java @@ -51,9 +51,9 @@ public static ByteBuffer modifySparkplugTimestamp(Boolean useCompression, ByteBu byte[] bytes = null; // Compress payload (optional) if (useCompression) { - bytes = encoder.getBytes(org.eclipse.tahu.util.PayloadUtil.compress(payload, compressionAlgorithm)); + bytes = encoder.getBytes(org.eclipse.tahu.util.PayloadUtil.compress(payload, compressionAlgorithm, false), false); } else { - bytes = encoder.getBytes(payload); + bytes = encoder.getBytes(payload, false); } return ByteBuffer.wrap(bytes); } diff --git a/src/test/java/com/hivemq/extensions/sparkplug/aware/SparkplugPublishOutboundInterceptorTest.java b/src/test/java/com/hivemq/extensions/sparkplug/aware/SparkplugPublishOutboundInterceptorTest.java index 14011af..e4c67af 100644 --- a/src/test/java/com/hivemq/extensions/sparkplug/aware/SparkplugPublishOutboundInterceptorTest.java +++ b/src/test/java/com/hivemq/extensions/sparkplug/aware/SparkplugPublishOutboundInterceptorTest.java @@ -113,7 +113,7 @@ private byte[] createSparkplugBPayload() throws IOException, SparkplugInvalidTyp .timestamp(new Date()) .createMetric()); SparkplugBPayload sparkplugBPayload = new SparkplugBPayload(new Date(), metrics, 1L, "alf", null); - return new SparkplugBPayloadEncoder().getBytes(sparkplugBPayload); + return new SparkplugBPayloadEncoder().getBytes(sparkplugBPayload,false); } } \ No newline at end of file diff --git a/src/test/java/com/hivemq/extensions/sparkplug/aware/SparkplugSubscribeInterceptorTest.java b/src/test/java/com/hivemq/extensions/sparkplug/aware/SparkplugSubscribeInterceptorTest.java index c31529e..b7cb7e7 100644 --- a/src/test/java/com/hivemq/extensions/sparkplug/aware/SparkplugSubscribeInterceptorTest.java +++ b/src/test/java/com/hivemq/extensions/sparkplug/aware/SparkplugSubscribeInterceptorTest.java @@ -104,7 +104,7 @@ private byte[] createSparkplugBPayload() throws IOException, SparkplugInvalidTyp .timestamp(new Date()) .createMetric()); SparkplugBPayload sparkplugBPayload = new SparkplugBPayload(new Date(), metrics, 1L, null, null); - return new SparkplugBPayloadEncoder().getBytes(sparkplugBPayload); + return new SparkplugBPayloadEncoder().getBytes(sparkplugBPayload, false); } } \ No newline at end of file diff --git a/src/test/java/com/hivemq/extensions/sparkplug/aware/utils/PayloadUtilTest.java b/src/test/java/com/hivemq/extensions/sparkplug/aware/utils/PayloadUtilTest.java index 3957b79..705cb5d 100644 --- a/src/test/java/com/hivemq/extensions/sparkplug/aware/utils/PayloadUtilTest.java +++ b/src/test/java/com/hivemq/extensions/sparkplug/aware/utils/PayloadUtilTest.java @@ -70,7 +70,7 @@ private byte[] createSparkplugBPayload() throws IOException, SparkplugInvalidTyp .createMetric()); SparkplugBPayload sparkplugBPayload = new SparkplugBPayload(new Date(), metrics, 1L, null, null); - return new SparkplugBPayloadEncoder().getBytes(sparkplugBPayload); + return new SparkplugBPayloadEncoder().getBytes(sparkplugBPayload, false); } } \ No newline at end of file