Updated to new kafka client version with an option to connect to secured kafka cluster#30
Updated to new kafka client version with an option to connect to secured kafka cluster#30satendra-sahu wants to merge 24 commits intoHomeAdvisor:masterfrom
Conversation
Secured kafka
minor change in high level consumer
Secured kafka
src/main/java/com/homeadvisor/kafdrop/service/KafkaHighLevelConsumer.java
Outdated
Show resolved
Hide resolved
|
can you let me know when is the functionality available for secured cluster connectivity? |
|
@dhayha Any plans to merge this pull request?. |
|
can i vote for merging this ? would make kafdrop even more useful in a SASL_SCRAM env |
|
happy to help with any testing etc. |
| String path; | ||
|
|
||
| if (isSecured) { | ||
| if ((env.equalsIgnoreCase("stage") || env.equalsIgnoreCase("prod") || env.equalsIgnoreCase("local"))) { |
There was a problem hiding this comment.
Is there something special about these particular environment names? Would rather not dictate how folks organize their environments. There's already a check for a non-null environment, so couldn't this just use the environment name as provided?
| Boolean isSecured = environment.getProperty("kafka.isSecured", Boolean.class); | ||
| LOG.info("env: {} .Issecured kafka: {}", env, isSecured); | ||
| if (isSecured && Strings.isNullOrEmpty(env)) { | ||
| throw new RuntimeException("'env' cannot be null if connecting to secured kafka."); |
There was a problem hiding this comment.
Seems like IllegalArgumentException or IllegalStateException would be a more appropriate exception here.
|
|
||
| @ResponseStatus(HttpStatus.OK) | ||
| @RequestMapping("/health_check") | ||
| public void healthCheck() |
There was a problem hiding this comment.
Spring Boot already provides a health status endpoint. What is this endpoint needed for?
|
|
||
| public Map<Integer, TopicPartitionVO> getPartitionMap() | ||
| { | ||
| return partitions; |
There was a problem hiding this comment.
If we're going to expose this map, let's make it unmodifiable (e.g. Collections.unmodifiableMap(partitions))
| linkText.toggleClass('fa-chevron-circle-down fa-chevron-circle-right'); | ||
| }); | ||
| }); No newline at end of file | ||
| .page-header { |
There was a problem hiding this comment.
I think something didn't merge right. CSS doesn't belong in a JS file.
Made changes to support new kafka client versions. Has an ability to connect to secured kafka cluster using JaaS configuration file.
Following are the changes:
Added following properties to application.yml
To run the application jaas file should be present in the user.dir. jaas config file is picked up based on the env specified in kafka.evn property. Ex if env=local then "kaas_local_jaas.conf" will be used for authentication.