diff --git a/src/main/java/com/appdynamics/extensions/kafka/JMXConnectionAdapter.java b/src/main/java/com/appdynamics/extensions/kafka/JMXConnectionAdapter.java index 06c0817..589f67c 100644 --- a/src/main/java/com/appdynamics/extensions/kafka/JMXConnectionAdapter.java +++ b/src/main/java/com/appdynamics/extensions/kafka/JMXConnectionAdapter.java @@ -56,7 +56,7 @@ JMXConnector open(Map connectionMap) throws IOException { JMXConnector jmxConnector; final Map env = new HashMap<>(); - if(Boolean.valueOf(connectionMap.get(Constants.USE_SSL).toString())) { + if(Boolean.valueOf((String)connectionMap.get(Constants.USE_SSL))) { //TODO this is not needed as even if you comment it the SSL connections still work. SslRMIClientSocketFactory sslRMIClientSocketFactory = new SslRMIClientSocketFactory(); env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, sslRMIClientSocketFactory); diff --git a/src/main/java/com/appdynamics/extensions/kafka/KafkaMonitorTask.java b/src/main/java/com/appdynamics/extensions/kafka/KafkaMonitorTask.java index fd5c04b..7a038ae 100644 --- a/src/main/java/com/appdynamics/extensions/kafka/KafkaMonitorTask.java +++ b/src/main/java/com/appdynamics/extensions/kafka/KafkaMonitorTask.java @@ -100,6 +100,7 @@ private BigDecimal openJMXConnection () { Map requestMap = buildRequestMap(); jmxAdapter = JMXConnectionAdapter.create(requestMap); Map connectionMap = (Map) getConnectionParameters(); + connectionMap.put(Constants.USE_SSL, this.kafkaServer.get(Constants.USE_SSL)); logger.debug("[useSsl] is set [{}] for server [{}]", connectionMap.get(Constants.USE_SSL), this.kafkaServer.get(Constants.DISPLAY_NAME)); if (configuration.getConfigYml().containsKey(Constants.ENCRYPTION_KEY) &&