aws / aws-msk-iam-auth

Enables developers to use AWS Identity and Access Management (IAM) to connect to their Amazon Managed Streaming for Apache Kafka (Amazon MSK) clusters.
Apache License 2.0
138 stars 65 forks source link

awsMaxRetries is not working #170

Open dsinghal-nice opened 2 months ago

dsinghal-nice commented 2 months ago

Hello All,

I am using MSK IAM authentication mechanism to authenticate my consumer with MSK cluster and topic, I have added below configuration

software.amazon.msk.auth.iam.IAMLoginModule required awsRoleArn="%s" awsRoleSessionName="%s" awsDebugCreds=%s awsMaxRetries="3";

My assume role arn doesn't have permission for a specific Topic and the kafka consumer throws error for the same only one time, it doesn't tries to retry after default waiting time to again do assume role and check for authorization.

Can you please help me for looking into this use case.

jvdadda commented 2 months ago

Hi @dsinghal-nice, you have the problem with which version ? 2.0.x or 2.1.x ? And if you can try with the version that you do not use to target the problem

Thanks

dsinghal-nice commented 2 months ago

Hi @jvdadda, I am currently using 2.1.0 version I can try with 2.0.0 as well.

dsinghal-nice commented 2 months ago

Hi @jvdadda, I also noticed one more issue we are assuming role in other account, and suppose the first time it has access to the Topic it will fetch the messages from the broker. (This IAM session lasts long for an hour) Now when we turn off the Topic permission, it starts to throw the Topic Authorization Error immediately after 1-2 mins. But now when I turn back the Topic permission back it doesn't tries to start a new session again and start consuming even after 1 hour of session expiry.

Can you please check if there is any mechanism to handle this issue or is it a bug ?