Add support for WireFormat configuration#266
Merged
Merged
Conversation
zZHorizonZz
force-pushed
the
wire-format-class
branch
from
May 4, 2026 06:11
a42d0e6 to
c1f0e5f
Compare
Member
Author
|
@mutexd If you want you can also review, I think this should allow more configuration in the future |
zZHorizonZz
force-pushed
the
wire-format-class
branch
from
May 4, 2026 06:38
c1f0e5f to
efc804b
Compare
vietj
reviewed
May 4, 2026
Contributor
It looks good to me. I also tried it out and it works just as expected. Thanks. |
zZHorizonZz
force-pushed
the
wire-format-class
branch
6 times, most recently
from
May 18, 2026 13:34
6e15eab to
76d5171
Compare
zZHorizonZz
force-pushed
the
wire-format-class
branch
from
June 2, 2026 18:41
76d5171 to
e3037e1
Compare
vietj
reviewed
Jun 4, 2026
vietj
reviewed
Jun 4, 2026
Member
|
we should move ProtobufJsonReader and ProtobufJsonWriter to impl package and not expose this for the moment, and we open it to module that actually use it, I want to keep the surface API small |
vietj
reviewed
Jun 4, 2026
vietj
reviewed
Jun 4, 2026
vietj
reviewed
Jun 4, 2026
| return 415; | ||
| } | ||
|
|
||
| if (!options.isFormatEnabled(details.format)) { |
Member
Author
There was a problem hiding this comment.
It is vertx-grpc-server/src/test/java/io/vertx/tests/server/FormatSupportTest.java
zZHorizonZz
force-pushed
the
wire-format-class
branch
from
June 30, 2026 04:08
74be7cf to
666f52f
Compare
vietj
approved these changes
Jun 30, 2026
- Allow customization of JSON printer and parser configurations for gRPC transcoding trough WireFormat configuration. Changes: - Added ability to configure supported wireformats on server. - Added `JsonWireFormat` and `ProtobufWireFormat` as concrete implementations of `WireFormat`. - Updated `GrpcMessageEncoder` and `GrpcMessageDecoder` to respect custom wire formats. - Added `ProtobufJsonReader` and `ProtobufJsonWriter`. - Updated transcoding logic to use specific wire formats. Signed-off-by: Daniel Fiala <danfiala23@gmail.com>
Motivation: - Simplify API for configuring JSON reader and writer flags in `JsonWireFormat`. Changes: - Replaced `WriterConfig` and `ReaderConfig` with direct boolean flags in `JsonWireFormat`. - Updated `GrpcMessageEncoder` and `GrpcMessageDecoder` to use the simplified `JsonWireFormat`. - Refactored `ProtobufJsonWriter` and `ProtobufJsonReader` to accept simplified `JsonWireFormat`. - Updated tests to use the new `JsonWireFormat` flag-based API. - Removed unused configuration classes and redundant imports. Signed-off-by: Daniel Fiala <danfiala23@gmail.com>
…and extensibility. Motivation: - Improve readability and ensure robust handling of `WireFormat` values in EventBus gRPC server implementation. Changes: - Refactored validation and parsing of the `grpc-wire-format` header in `EventBusGrpcServerImpl` to handle unknown formats gracefully. - Replaced hardcoded string comparisons with `WireFormat` enumeration values in tests and implementation. - Updated `dispatch` method to accept `WireFormat` directly, simplifying usage. - Adjusted related JavaDocs for better description of `grpc-wire-format`.
Motivation: - Align method names with standard practices by removing the `get` prefix for boolean accessors to enhance readability and maintain consistency across the codebase. Changes: - Renamed all `get*` methods to remove the `get` prefix in `JsonWireFormat`. - Updated `ProtobufJsonWriterImpl` and `ProtobufJsonReaderImpl` to use the renamed methods. Signed-off-by: Daniel Fiala <danfiala23@gmail.com>
Motivation: - Reduce unnecessary complexity by introducing a flag-based implementation for `JsonWireFormat`. Changes: - Simplified `JsonWireFormat` by replacing boolean fields with a compact flag-based system. - Added caching for `JsonWireFormat` to improve memory efficiency. - Introduced a `mediaType` method to both `JsonWireFormat` and `ProtobufWireFormat` for determining content type dynamically. - Updated all components to use the new media type method for content type handling. - Replaced hardcoded wire format comparisons with reusable `mediaType`. Signed-off-by: Daniel Fiala <danfiala23@gmail.com>
…nto single classes. Motivation: - Simplify the codebase by eliminating separate `Impl` classes that provide no additional value. - Improve clarity by making `ProtobufJsonReader` and `ProtobufJsonWriter` self-contained. Changes: - Merged `ProtobufJsonReaderImpl` into `ProtobufJsonReader`. - Merged `ProtobufJsonWriterImpl` into `ProtobufJsonWriter`. - Updated constructors to handle `JsonWireFormat` directly within unified classes. - Removed redundant `Impl` classes and adjusted usage across the codebase.
zZHorizonZz
force-pushed
the
wire-format-class
branch
from
June 30, 2026 13:20
666f52f to
28caa1c
Compare
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.
Motivation:
Changes:
JsonWireFormatandProtobufWireFormatas concrete implementations ofWireFormat.GrpcMessageEncoderandGrpcMessageDecoderto respect custom wire formats.ProtobufJsonReaderandProtobufJsonWriter.Closes: #261
Supersedes: #252