title: Where is the place to register a Jackson Codec in Vertx 4.0 using custom Object Mapper
body: <p>I am trying to convert <a href="https://github.com/hantsy/quarkus-sample/blob/master/vertx-routes/" rel="noreferrer">my Quarkus vertex sample</a> to pure <a href="https://github.com/hantsy/vertx-sandbox/blob/master/post-service/" rel="noreferrer">Vertx 4.0</a> and encountered a problem.</p>
  <p>In Quarkus, it is easy to customize the Jackson ObjectMapper to serialize or deserialize the HTTP messages.</p>
  <pre class="lang-java prettyprint-override"><code>
  @ApplicationScoped
  public class CustomObjectMapper implements ObjectMapperCustomizer {
  
      @Override
      public void customize(ObjectMapper objectMapper) {
          objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
          objectMapper.disable(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS);
          objectMapper.disable(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS);
  
          JavaTimeModule module = new JavaTimeModule();
          LocalDateTimeDeserializer localDateTimeDeserializer = new LocalDateTimeDeserializer(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
          module.addDeserializer(LocalDateTime.class, localDateTimeDeserializer);
          objectMapper.registerModule(module);
      }
  }
  </code></pre>
  <p>And in Vertx, how to customize the <code>ObjectMapper</code> gracefully? My intention is registering a custom <code>ObjectMapper</code> instead of the built-in one, thus when using <code>Json.encode</code>, it will use my custom <code>objectMapper</code> instead.</p>
  <p>In <a href="https://github.com/hantsy/vertx-sandbox/blob/master/post-service/src/main/java/com/example/demo/PostsHandler.java#L32" rel="noreferrer">my Vertx sample</a>, the <code>Json.encode</code> will use the built-in <code>objectMapper</code> to serialize the Java 8 DateTime to an int array instead of an ISO date string.</p>