OneCricketeer commented on pull request #7965:
URL: https://github.com/apache/kafka/pull/7965#issuecomment-991928166


   Well, Kafka record have their own timestamps since version 0.10.2, so they 
shouldn't need to be part of the record string... 
   
   > no idea how or where to begin with that 
   
   Assuming Java, then
   
   ```
   public class MyDeserializer extends StringDeserializer {
     private int dateLength = "YYYYmmdd".length; // for example 
     @Override
     public void deserialize(String topic, byte[] data) {
       String s = super.deserialize(data);
       return s.substring(dateLength);
    } 
   }
   ```
   
   In the consumer config, set `value.deserializer` to `MyDeserializer.class`
   
   In your poll loop, accept strings and use a JSON library to further process 
the record 


-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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


Reply via email to