Skip to content

Commit

Permalink
Merge pull request #10 from hivemq/update-4.24.0
Browse files Browse the repository at this point in the history
Update 4.24.0
  • Loading branch information
skobow authored Feb 9, 2024
2 parents 5400544 + f7ad3a8 commit a1e78a1
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If it does, it MUST set the timestamp to the UTC time at which it attempts to de

== Configuration

The Extension expects the configuration file `sparkplug.properties` in the extension home folder.
The Extension expects the configuration file `conf/sparkplug.properties` in the extension home folder.
This configuration file contains a set of properties to align the behavior of the extension.

The topic structure root for the systopic, and the sparkplug version can be configured.
Expand All @@ -53,7 +53,7 @@ sparkplug.systopic.msgExpiry=4294967296

== JSON Logging configuration

When using logger sparkplug.json.log, add the configuration settings `appender` and `logger` from the `src/hivemq-extension/logback-example.xml` file to your `hivemq/conf/logback.xml` configuration.
When using logger sparkplug.json.log, add the configuration settings `appender` and `logger` from the `src/hivemq-extension/conf/logback-example.xml` file to your `hivemq/conf/logback.xml` configuration.
With this, the sparkplug payload will be written as json into the separate file `hivemq/log/sparkplug-json-payload.log`.

== Installation
Expand Down
14 changes: 14 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import org.gradle.crypto.checksum.Checksum

plugins {
alias(libs.plugins.hivemq.extension)
alias(libs.plugins.defaults)
alias(libs.plugins.license)
alias(libs.plugins.checksum)
}

group = "com.hivemq.extensions.sparkplug.aware"
Expand All @@ -19,6 +22,17 @@ hivemqExtension {
}
}

task<Checksum>("checksum") {
dependsOn("hivemqExtensionZip")
checksumAlgorithm.set(Checksum.Algorithm.SHA256)
inputFiles.setFrom(
files(
tasks.hivemqExtensionZip.get().outputs.files
)
)
outputDirectory.set(file("${layout.buildDirectory.get()}/hivemq-extension"))
}

repositories {
mavenCentral()
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=4.9.1
version=4.24.0
3 changes: 2 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
commonsLang = "3.8.1"
guava = "31.1-jre"
hivemq-extensionSdk = "4.22.0"
hivemq-extensionSdk = "4.24.0"
jackson = "2.13.2"
jacksonv1 = "1.9.13"
jetbrains-annotations = "24.0.1"
Expand All @@ -25,3 +25,4 @@ tahu = { module = "org.eclipse.tahu:tahu-core", version.ref = "tahu" }
hivemq-extension = { id = "com.hivemq.extension", version = "3.1.0" }
defaults = { id = "io.github.sgtsilvio.gradle.defaults", version = "0.2.0" }
license = { id = "com.github.hierynomus.license", version = "0.16.1" }
checksum = { id = "org.gradle.crypto.checksum", version = "1.4.0"}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private void addPublishModifier() {
private boolean configurationValidated(
final @NotNull ExtensionStartOutput extensionStartOutput, final @NotNull File extensionHomeFolder) {
boolean isValid;
configuration = new SparkplugConfiguration(extensionHomeFolder);
configuration = new SparkplugConfiguration(new File(extensionHomeFolder, "conf"));
try {
isValid = configuration.readPropertiesFromFile();
configuration.getSparkplugVersion();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2018-present HiveMQ GmbH
*
* Licensed 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 implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hivemq.extensions.sparkplug.aware.configuration;

import org.junit.jupiter.api.Test;

import java.io.File;

import static org.junit.jupiter.api.Assertions.*;

class SparkplugConfigurationTest {

@Test
void shouldReadConfigurationFromFile() {
final File extensionFolder = new File("src/hivemq-extension");
final boolean valid = new SparkplugConfiguration(new File(extensionFolder, "conf")).readPropertiesFromFile();

assertTrue(valid);
}
}

0 comments on commit a1e78a1

Please sign in to comment.