In terms of our rest client:
We use the vert.x mutiny http client to do HTTP calls passing JSON
Bodies. E.g. something like (pseudocode):
@Inject
ObjectMapper jacksonMapper;
SomeObject obj = new SomeObject();
obj.setName("Hello");
obj.setAge(10);
io.vertx.mutiny.core.http.HttpClient httpClient =
io.vertx.mutiny.core.Vertx.newInstance(vertx).createHttpClient(options);
String myJson = jacksonMapper.writeValueAsString(obj);
Uni<HttpClientResponse> responseUni = httpClient
.request(requestOptions)
.onItem()
.transformToUni((HttpClientRequest request) -> {
log.debug("Sending request body");
request.send(myJson);
});
Then when we get the response we buffer the result and deserialise
back to an object using jacksonMapper
So you can see, the new feature uses the non-reflection serialisers
and deserialisers for JaxRS request/responses hosted by Quarkus but if
inside Quarkus one wants to serialise and deserialise using jackson,
how can one:
1) Mark a POJO as needing to be build time generated for this optimisation
2) Have a objectMapper that uses these serialisers and deserialisers
that can be used by user code at runtime
FYI we already have a customizer that implements
ObjectMapperCustomizer. Maybe something like calling Quarkus with our
mapper and give it the opportunity to enrol the optimised classes:
@Override
public void customize(ObjectMapper jacksonMapper) {
Quarkus.addOptimizedSerializers(jacksonMapper);
Quarkus.addOptimizedDeSerializers(jacksonMapper);
... rest of our own user level customizations