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

Notify producer and consumer clients when schemas are uploaded on topic #2060

Merged
merged 5 commits into from
Nov 28, 2023

Conversation

muralibasani
Copy link
Contributor

Linked issue

Resolves: #1068

What kind of change does this PR introduce?

This change adds a functionality.

  • Notifies all producers and consumers of a topic for a particular environment, when there are new schemas uploaded onto a topic

  • Team mail ids are used here

  • Bug fix

  • [ X] New feature

  • Refactor

  • Docs update

  • CI update

What is the current behavior?

Describe the state of the application before this PR. Illustrations appreciated (videos, gifs, screenshots).
Currently topic subscribers are not notified when there are schema uploads on topic

What is the new behavior?

Describe the state of the application after this PR. Illustrations appreciated (videos, gifs, screenshots).
This change notifies topic subscribers when there are new schemas uploaded to topic

Other information

Additional changes, explanations of the approach taken, unresolved issues, necessary follow ups, etc.

Requirements (all must be checked before review)

  • The pull request title follows our guidelines
  • Tests for the changes have been added (if relevant)
  • The latest changes from the main branch have been pulled
  • pnpm lint has been run successfully

muralibasani added 2 commits November 28, 2023 12:52
Signed-off-by: muralibasani <[email protected]>
Copy link
Contributor

@aindriu-aiven aindriu-aiven left a comment

Choose a reason for hiding this comment

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

Just a couple of comments.

NEW_USER_ADDED,
RESET_CONSUMER_OFFSET_REQUESTED,
RESET_CONSUMER_OFFSET_APPROVED,
RESET_CONSUMER_OFFSET_DENIED
RESET_CONSUMER_OFFSET_DENIED,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be a trailing comma here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it was by mistake.

String topic = schemaRequest.getTopicname();
String schemaRequestEnvironment = schemaRequest.getEnvironment();
Optional<Env> optionalKafkaEnv =
manageDatabase.getKafkaEnvList(tenantId).stream()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
manageDatabase.getKafkaEnvList(tenantId).stream()
Optional<Env> optSchemaEnv = manageDatabase.getEnv(tenantId,schemaRequestEnvironment);
//add null pointer checks.
Optional<Env> optKafkaEnv = manageDatabase.getEnv(tenantId,optSchemaEnv .get().getAssociatedEnv().getId);

Signed-off-by: muralibasani <[email protected]>
manageDatabase
.getHandleDbRequests()
.getSyncAcls(optionalKafkaEnv.get().getId(), topic, tenantId);
optionalEnv =
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these OptionalEnv and the OptionalKafkaEnv the same object?

Signed-off-by: muralibasani <[email protected]>
Copy link
Contributor

@aindriu-aiven aindriu-aiven left a comment

Choose a reason for hiding this comment

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

LGTM

@muralibasani muralibasani merged commit 14a5068 into main Nov 28, 2023
16 checks passed
@muralibasani muralibasani deleted the notify-clients branch November 28, 2023 17:19
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.

Notify producers/consumers on schema changes
2 participants