Persi opened a new issue #6842:
URL: https://github.com/apache/pulsar/issues/6842


   **Is your feature request related to a problem? Please describe.**
   I am trying to use Pulsar Java client in a Spring Boot application and was 
able to produce and consume messages. I ran in trouble when sending messages 
with JSON content which contains fields of type OffsetDateTime. My Spring Boot 
application already uses the same JSON for it's REST API and can serialize and 
deserialize OffsetDateTime as "jackson-datatype-jsr310" is in my classpath. But 
the included version of Jackson in the Pulsar Java client, does not know this 
extension and instead fails while deserialization with erros like the following:
   ```
   ...
   Caused by: 
org.apache.pulsar.shade.com.fasterxml.jackson.databind.exc.InvalidDefinitionException:
 
   Cannot construct instance of `java.time.OffsetDateTime` (no Creators, like 
default construct, exist): cannot deserialize from Object value (no delegate- 
or property-based Creator)
   ```
   
   **Describe the solution you'd like**
   Could you provide a non-shaded version of the Pulsar Java client? This would 
be really helpful for Spring Boot integrations, as most Spring Boot 
applications already provide a global configured instance of Jackson 
ObjectMapper, which the Pulsar Java client could use, to use the same mapping 
settings as the rest of the application.
   
   **Describe alternatives you've considered**
   The JSONSchema class instanciates it's ObjectMapper as internal ThreadLocal 
which makes it unchangeble as well as unconfigurable. You could add the 
opportunity to provide an ObjectMapper instance, e.g. on pulsar client 
instanciation, which could be used by all producers and consumers created.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to