Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to new kafka client version with an option to connect to secured kafka cluster #30

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

satendra-sahu
Copy link

@satendra-sahu satendra-sahu commented Sep 28, 2018

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

     kafka:
         env: local
         brokerConnect: localhost:9092
         isSecured: true
    
     zookeeper:
         connect: localhost:2181
    
  • 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.

@bj9306
Copy link

bj9306 commented Mar 15, 2019

can you let me know when is the functionality available for secured cluster connectivity?

@satendra-sahu
Copy link
Author

@dhayha Any plans to merge this pull request?.

@winter98
Copy link

winter98 commented Apr 2, 2019

can i vote for merging this ? would make kafdrop even more useful in a SASL_SCRAM env

@winter98
Copy link

winter98 commented Apr 2, 2019

happy to help with any testing etc.

String path;

if (isSecured) {
if ((env.equalsIgnoreCase("stage") || env.equalsIgnoreCase("prod") || env.equalsIgnoreCase("local"))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like IllegalArgumentException or IllegalStateException would be a more appropriate exception here.


@ResponseStatus(HttpStatus.OK)
@RequestMapping("/health_check")
public void healthCheck()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spring Boot already provides a health status endpoint. What is this endpoint needed for?


public Map<Integer, TopicPartitionVO> getPartitionMap()
{
return partitions;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to expose this map, let's make it unmodifiable (e.g. Collections.unmodifiableMap(partitions))

.page-header {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something didn't merge right. CSS doesn't belong in a JS file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants