From 557f95f37a524e3063ce9fc0b63c85b548987811 Mon Sep 17 00:00:00 2001 From: mayur-solace Date: Mon, 22 Jul 2024 11:30:55 -0400 Subject: [PATCH] DATAGO-79228: mark beans as @Nullable --- .../health/handlers/SolaceSessionEventHandler.java | 9 ++++----- .../config/SolaceMessageChannelBinderConfiguration.java | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/solace-spring-cloud-stream-binder/solace-spring-cloud-stream-binder-core/src/main/java/com/solace/spring/cloud/stream/binder/health/handlers/SolaceSessionEventHandler.java b/solace-spring-cloud-stream-binder/solace-spring-cloud-stream-binder-core/src/main/java/com/solace/spring/cloud/stream/binder/health/handlers/SolaceSessionEventHandler.java index 688ca928..ac9091c8 100644 --- a/solace-spring-cloud-stream-binder/solace-spring-cloud-stream-binder-core/src/main/java/com/solace/spring/cloud/stream/binder/health/handlers/SolaceSessionEventHandler.java +++ b/solace-spring-cloud-stream-binder/solace-spring-cloud-stream-binder-core/src/main/java/com/solace/spring/cloud/stream/binder/health/handlers/SolaceSessionEventHandler.java @@ -7,13 +7,14 @@ import com.solacesystems.jcsmp.SolaceSessionOAuth2TokenProvider; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.lang.Nullable; public class SolaceSessionEventHandler extends DefaultSolaceOAuth2SessionEventHandler { private final SessionHealthIndicator sessionHealthIndicator; private static final Log logger = LogFactory.getLog(SolaceSessionEventHandler.class); public SolaceSessionEventHandler(JCSMPProperties jcsmpProperties, - SolaceSessionOAuth2TokenProvider solaceSessionOAuth2TokenProvider, + @Nullable SolaceSessionOAuth2TokenProvider solaceSessionOAuth2TokenProvider, SessionHealthIndicator sessionHealthIndicator) { super(jcsmpProperties, solaceSessionOAuth2TokenProvider); this.sessionHealthIndicator = sessionHealthIndicator; @@ -24,13 +25,11 @@ public void handleEvent(SessionEventArgs eventArgs) { if (logger.isDebugEnabled()) { logger.debug(String.format("Received Solace JCSMP Session event [%s]", eventArgs)); } + super.handleEvent(eventArgs); switch (eventArgs.getEvent()) { case RECONNECTED -> this.sessionHealthIndicator.up(); case DOWN_ERROR -> this.sessionHealthIndicator.down(eventArgs); - case RECONNECTING -> { - super.handleEvent(eventArgs); - this.sessionHealthIndicator.reconnecting(eventArgs); - } + case RECONNECTING -> this.sessionHealthIndicator.reconnecting(eventArgs); } } diff --git a/solace-spring-cloud-stream-binder/solace-spring-cloud-stream-binder/src/main/java/com/solace/spring/cloud/stream/binder/config/SolaceMessageChannelBinderConfiguration.java b/solace-spring-cloud-stream-binder/solace-spring-cloud-stream-binder/src/main/java/com/solace/spring/cloud/stream/binder/config/SolaceMessageChannelBinderConfiguration.java index 7dfc0c12..0c056c9a 100644 --- a/solace-spring-cloud-stream-binder/solace-spring-cloud-stream-binder/src/main/java/com/solace/spring/cloud/stream/binder/config/SolaceMessageChannelBinderConfiguration.java +++ b/solace-spring-cloud-stream-binder/solace-spring-cloud-stream-binder/src/main/java/com/solace/spring/cloud/stream/binder/config/SolaceMessageChannelBinderConfiguration.java @@ -40,6 +40,8 @@ public class SolaceMessageChannelBinderConfiguration { private JCSMPSession jcsmpSession; private Context context; + + @Nullable private SolaceSessionOAuth2TokenProvider solaceSessionOAuth2TokenProvider; private static final Log logger = LogFactory.getLog(SolaceMessageChannelBinderConfiguration.class);