diff --git a/solarnet/build.gradle b/solarnet/build.gradle index 618557d95..46a4ba262 100644 --- a/solarnet/build.gradle +++ b/solarnet/build.gradle @@ -68,7 +68,7 @@ subprojects { jsonSchemaValidatorVersion = '1.0.73' myBatisStarterVersion = '3.0.3' snCommonVersion = '3.5.2' - snCommonMqttVersion = '4.0.0' + snCommonMqttVersion = '4.0.1' snCommonMqttNettyVersion = '3.0.1' snCommonOcppVersion = '2.7.0' snCommonOcpp16Version = '2.1.7' diff --git a/solarnet/common-test/build.gradle b/solarnet/common-test/build.gradle index 0bbdc7dc8..a48b19ddf 100644 --- a/solarnet/common-test/build.gradle +++ b/solarnet/common-test/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.2.0' apply false + id 'org.springframework.boot' version '3.2.1' apply false } apply plugin: 'java-library' diff --git a/solarnet/common/build.gradle b/solarnet/common/build.gradle index d70f548cb..9cccc05bf 100644 --- a/solarnet/common/build.gradle +++ b/solarnet/common/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.2.0' apply false + id 'org.springframework.boot' version '3.2.1' apply false } apply plugin: 'java-library' diff --git a/solarnet/datum/build.gradle b/solarnet/datum/build.gradle index 9c20ae660..823b87117 100644 --- a/solarnet/datum/build.gradle +++ b/solarnet/datum/build.gradle @@ -1,7 +1,7 @@ plugins { id 'java-library' id 'eclipse' - id 'org.springframework.boot' version '3.2.0' apply false + id 'org.springframework.boot' version '3.2.1' apply false } apply plugin: 'java-library' @@ -14,7 +14,7 @@ dependencyManagement { } description = 'SolarNet: Datum' -version = '2.1.0' +version = '2.2.0' base { archivesName = 'solarnet-datum' diff --git a/solarnet/datum/src/main/java/net/solarnetwork/central/datum/flux/SolarFluxDatumPublisher.java b/solarnet/datum/src/main/java/net/solarnetwork/central/datum/flux/SolarFluxDatumPublisher.java index f107b08aa..9ebc083b8 100644 --- a/solarnet/datum/src/main/java/net/solarnetwork/central/datum/flux/SolarFluxDatumPublisher.java +++ b/solarnet/datum/src/main/java/net/solarnetwork/central/datum/flux/SolarFluxDatumPublisher.java @@ -44,7 +44,7 @@ * Publish datum to SolarFlux. * * @author matt - * @version 2.1 + * @version 2.2 */ public class SolarFluxDatumPublisher extends MqttJsonPublisher> implements DatumProcessor { @@ -65,7 +65,13 @@ public class SolarFluxDatumPublisher extends MqttJsonPublisher 0 ) { + final long now = System.currentTimeMillis(); + final long tdiff = errorLogLimitMs > 0 ? now - lastErrorTime : lastErrorTime; + if ( tdiff >= lastErrorTime ) { + logPublishError(e, root, aggregation); + lastErrorTime = now; + } else { + log.debug("Problem publishing {} datum to SolarFlux: {}", + aggDisplayName(aggregation), root.getMessage()); + } } else { - log.error("Error publishing {} datum to SolarFlux: {}", aggDisplayName(aggregation), - root.toString(), e); + logPublishError(e, root, aggregation); } } return false; } + private void logPublishError(Throwable e, Throwable root, Aggregation aggregation) { + if ( (root instanceof RemoteServiceException) + || (root instanceof net.solarnetwork.service.RemoteServiceException) ) { + log.warn("Problem publishing {} datum to SolarFlux: {}", aggDisplayName(aggregation), + root.getMessage()); + } else { + log.error("Problem publishing {} datum to SolarFlux: {}", aggDisplayName(aggregation), + root.toString(), e); + } + } + private static String aggDisplayName(Aggregation aggregation) { return aggregation == Aggregation.None ? "Raw" : aggregation.toString(); } @@ -194,4 +216,25 @@ private String topicForDatum(Aggregation aggregation, Identity