Merged
Conversation
Contributor
Reviewer's Guide by SourceryThis pull request introduces gRPC support for fetching events. It includes the necessary gRPC dependencies, protobuf definitions, server and client implementations, and an interface for the catchup server. It also implements the CatchupServerInterface in CatchupServer. Sequence diagram for fetching events via gRPCsequenceDiagram
participant Client
participant CatchupGrpcClient
participant CatchupGrpcServer
participant CatchupServer
Client->>CatchupGrpcClient: fetchEvents(startAfter, end, maxResults)
CatchupGrpcClient->>CatchupGrpcServer: fetchEvents(FetchEventsRequest)
CatchupGrpcServer->>CatchupServer: fetchEvents(startAfter, end, maxResults)
CatchupServer-->>CatchupGrpcServer: List<Event>
CatchupGrpcServer-->>CatchupGrpcClient: FetchEventsResponse
CatchupGrpcClient-->>Client: List<Event>
Class diagram for CatchupGrpcServerclassDiagram
class CatchupGrpcServer {
-int port
-Server server
+CatchupGrpcServer(int port, CatchupServerInterface catchupServer)
+void start()
+void stop()
+void blockUntilShutdown()
}
class CatchupServiceImpl {
-CatchupServerInterface catchupServer
+CatchupServiceImpl(CatchupServerInterface catchupServer)
+void fetchEvents(FetchEventsRequest request, StreamObserver~FetchEventsResponse~ responseObserver)
-Event convertToGrpcEvent(Event event)
}
CatchupGrpcServer -- CatchupServiceImpl : uses
CatchupServiceImpl -- CatchupServerInterface : uses
Class diagram for CatchupGrpcClientclassDiagram
class CatchupGrpcClient {
-ManagedChannel channel
-CatchupServiceBlockingStub blockingStub
-String topic
+CatchupGrpcClient(String host, int port, String topic)
+List~Event~ fetchEvents(long startAfter, long end, int maxResults)
-Event convertFromGrpcEvent(Event grpcEvent)
+void close()
}
CatchupGrpcClient -- CatchupServiceBlockingStub : uses
CatchupGrpcClient ..|> CatchupServerInterface : implements
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey @p14n - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a health check endpoint to the gRPC server for monitoring purposes.
- It might be useful to add some logging or metrics around gRPC request latency.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| grpcEvent.getDataschema(), | ||
| grpcEvent.getSubject(), | ||
| grpcEvent.getData().toByteArray(), | ||
| time.toInstant(), |
Contributor
There was a problem hiding this comment.
issue (bug_risk): Potential NullPointerException in time conversion.
If grpcEvent.getTime() returns an empty string, the variable 'time' remains null, and calling 'time.toInstant()' will throw a NullPointerException. Consider adding a null check or handling the absence of time appropriately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.