-
Notifications
You must be signed in to change notification settings - Fork 16
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
Made the grpc to use Managed channel directly to use it in blocking mode #1084
Conversation
@ConfigProperty(name = "quarkus.grpc.clients.embedding.port") | ||
private int port; | ||
|
||
private ManagedChannel channel = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be volatile
if there's no other synchronization?
|
||
@Inject DataApiRequestInfo dataApiRequestInfo; | ||
|
||
public boolean validate(String provider, String value) { | ||
if (channel == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about synchronization? Could make channel
synchronized; if this is used concurrently is it not necessary to consider synchronization?
@@ -31,4 +44,8 @@ public boolean validate(String provider, String value) { | |||
} | |||
return validateCredentialResponse.getValidity(); | |||
} | |||
|
|||
void onStop(@Observes ShutdownEvent ev) { | |||
channel.shutdown(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can channel
ever remain null
?
What this PR does:
Injecting blocking stub doesn't work on eventloop thread. Made token validation call as blocking channel.
Checklist