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

Setting cache topic replication factor #139

Open
deveshprobus opened this issue Jul 27, 2021 · 8 comments
Open

Setting cache topic replication factor #139

deveshprobus opened this issue Jul 27, 2021 · 8 comments

Comments

@deveshprobus
Copy link

I want to have the cache topic to be replicated. I have set props.put(KafkaCacheConfig.KAFKACACHE_TOPIC_REPLICATION_FACTOR_CONFIG, 3). In logs it says Creating the topic cache-test using a replication factor of 1, which is less than the desired one of 3.

@bharathr9889
Copy link

Hi
@rayokota
, I am working on kcache and was stuck.I want to connect to a kafka-server that is using saslssl protocol but we are not able to connect to that server.what is the exact kafkacache config which we have to set where we can set jaas config also?https://github.com/rayokota/kcache

@rayokota
Copy link
Owner

rayokota commented May 9, 2022

@bharathr9889
Copy link

@rayokota
io.kcache.exceptions.CacheInitializationException: Timed out trying to create or validate topic "mytopicname"

I am getting the above error, I have tried the above link too.

Checked the above link too, but it takes about all the parameters...it does not talk about which one to use to connect to sasl ssl...Pls help

@bharathr9889
Copy link

hi @rayokota
I have started using 4.0.3 which has the parameter to provide jaas config.

  1. However there is a issue in that if I use a topic that is already created :
    props.setProperty(KafkaCacheConfig.KAFKACACHE_TOPIC_CONFIG, "<Existing_topic>");

We get below error :
io.kcache.exceptions.CacheInitializationException: Failed trying to create or validate topic <Existing_topic>

......

Caused by: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TopicAuthorizationException: Authorization failed.
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022)
at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:180)
at io.kcache.KafkaCache.createTopic(KafkaCache.java:396)
at io.kcache.KafkaCache.createOrVerifyTopic(KafkaCache.java:350)

Note :
The calling method's class, io.kcache.KafkaCache, was loaded from the following location:

jar:file:/Users/breddy3/.m2/repository/io/kcache/kcache/4.0.3/kcache-4.0.3.jar!/io/kcache/KafkaCache.class

The called method's class, org.apache.kafka.clients.admin.DescribeTopicsResult, is available from the following locations:

jar:file:/Users/breddy3/.m2/repository/org/apache/kafka/kafka-clients/3.0.1/kafka-clients-3.0.1.jar!/org/apache/kafka/clients/admin/DescribeTopicsResult.class

The called method's class hierarchy was loaded from the following locations:

org.apache.kafka.clients.admin.DescribeTopicsResult: file:/Users/breddy3/.m2/repository/org/apache/kafka/kafka-clients/3.0.1/kafka-clients-3.0.1.jar
  1. If we use a topic that is non Existing :
    props.setProperty(KafkaCacheConfig.KAFKACACHE_TOPIC_CONFIG, "");

io.kcache.exceptions.CacheInitializationException: Failed trying to create or validate topic
at io.kcache.KafkaCache.createOrVerifyTopic(KafkaCache.java:360)
at io.kcache.KafkaCache.init(KafkaCache.java:276)

@nadjahagen
Copy link

@bharathr9889 did you configure the SASL/JAAS properties correctly? For me, it worked by using the following properties:

  • KafkaCacheConfig.KAFKACACHE_SECURITY_PROTOCOL_CONFIG
  • KafkaCacheConfig.KAFKACACHE_SASL_MECHANISM_CONFIG
  • KafkaCacheConfig.KAFKACACHE_SASL_JAAS_CONFIG_CONFIG

@bharathr9889
Copy link

bharathr9889 commented Jun 20, 2022

@nadjahagen

We were using below configuration :
Properties props = new Properties();
props.setProperty(KafkaCacheConfig.KAFKACACHE_BOOTSTRAP_SERVERS_CONFIG, "something.us-east-1.aws.confluent.cloud:9092");
props.setProperty(KafkaCacheConfig.KAFKACACHE_TOPIC_CONFIG, "some.topic");
props.setProperty(KafkaCacheConfig.KAFKACACHE_SECURITY_PROTOCOL_CONFIG, "SASL_SSL");
props.setProperty(KafkaCacheConfig.KAFKACACHE_SASL_MECHANISM_CONFIG,"PLAIN");
props.setProperty(KafkaCacheConfig.KAFKACACHE_SASL_JAAS_CONFIG_CONFIG,
"org.apache.kafka.common.security.plain.PlainLoginModule required username='SOMETHING' password='ENCRYPTED SOMETHING';");

  • But this does not work.Could you please share your configuration?

@bharathr9889
Copy link

@nadjahagen

@rayokota
Copy link
Owner

@bharathr9889 , it looks like you are using Confluent Cloud. Are you passing a valid API key as the username and a valid API secret as the password in the PlainLoginModule configuration?

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

No branches or pull requests

4 participants