greyp9 commented on a change in pull request #5311:
URL: https://github.com/apache/nifi/pull/5311#discussion_r704563580
##########
File path:
nifi-nar-bundles/nifi-standard-services/nifi-distributed-cache-services-bundle/nifi-distributed-cache-client-service/src/main/java/org/apache/nifi/distributed/cache/client/DistributedMapCacheClientService.java
##########
@@ -100,410 +114,180 @@
@OnEnabled
public void cacheConfig(final ConfigurationContext context) {
- this.configContext = context;
+ logger.info("onEnabled()");
+ this.enabled();
+ this.versionNegotiator = new StandardVersionNegotiator(3, 2, 1);
+ this.channelPool = NettyChannelPoolFactory.createChannelPool(context,
versionNegotiator);
+ this.cacheClient = new NettyDistributedCacheClient(channelPool);
+ }
+
+ @OnDisabled
+ public void onDisabled() {
+ logger.info("onDisabled()");
+ try {
+ this.cacheClient.invoke(new OutboundAdapter().write("close"), new
VoidInboundAdapter());
+ } catch (IOException e) {
+ logger.warn(e.getMessage());
Review comment:
For consistency, I'm removing the catch, and delegating handling of the
exception (the old pattern).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]