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

Enhance config #228

Merged
merged 13 commits into from
May 8, 2023
Merged

Enhance config #228

merged 13 commits into from
May 8, 2023

Conversation

akrambek
Copy link
Contributor

@akrambek akrambek commented May 4, 2023

Description

Improve config

Fixes #226

@@ -63,7 +63,7 @@ public JsonObject adaptToJson(
if (condition.service != null)
{
String method = condition.service;
method = condition.method != null ? method + "/" + condition.method : method;
method = condition.method != null ? String.format("%s/%s", method, condition.method) : method;
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we have /* on the end when the method is null instead of just the service by itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if the user has specified method: test then it doesn't expect /* I think no?

Copy link
Contributor

Choose a reason for hiding this comment

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

In the schema, we only have method now, but we're parsing the value into service and method, where the service part is required.

However, having the syntax method: test to mean the service is test and the method is * is too confusing, agree?

Recommend we change the pattern to require <Service>/<Method> where <Method> can be *, so that method: test/* means service test and any method.

Comment on lines 65 to 66
String method = condition.service;
method = condition.method != null ? method + "/" + condition.method : method;
method = condition.method != null ? String.format("%s/%s", method, condition.method) : method;
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
String method = condition.service;
method = condition.method != null ? method + "/" + condition.method : method;
method = condition.method != null ? String.format("%s/%s", method, condition.method) : method;
String method = String.format("%s/%s", condition.service, condition.method != null ? condition.method : "*");

@@ -164,9 +164,6 @@ public GrpcKafkaWithProduceResult resolveProduce(

GrpcKafkaWithProduceHash hash = new GrpcKafkaWithProduceHash(octetsRW, dashOctetsRW, correlationId, hashBytesRW);
hash.digestHash();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to call digestHash() here?

jfallows
jfallows previously approved these changes May 7, 2023
jfallows
jfallows previously approved these changes May 8, 2023
@jfallows jfallows merged commit 3753dd5 into aklivity:develop May 8, 2023
@akrambek akrambek deleted the enhancement/config branch May 8, 2023 21:40
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.

Enhance grpc related binding configuration
2 participants