You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/04/27 09:43:06 UTC

[GitHub] [pulsar] auterium opened a new pull request #4154: [Websockets] Add support for eventtime on producer message

auterium opened a new pull request #4154: [Websockets] Add support for eventtime on producer message
URL: https://github.com/apache/pulsar/pull/4154
 
 
   ### Motivation
   Websockets producer API lacks the message property `eventTime`, even when the client message supports it. This PR introduces support for WS producers to be able to optionally provide such property.
   
   ### Modifications
   The change impacts 2 packages:
   1. `pulsar-common`: within the utilities that this package provides, there's the `DateFormatter` which is used by the WS consumer API to format both the `eventTime` an the `publishTime`. The method `parse(String datetime)` is added to do the reverse process of `format(long timestamp)`. The method was added to this class as it's very close to it's functionality and depends on a private property that already contains proper timezone management.
   2. `pulsar-websocket`: the `eventTime` property is added to `ProducerMessage` class for adequate mapping as a string. If the property is not null when processing the message (`ProducerHandler.onWebSocketText()`) and the parsing fails, a `FailedToDeserializeFromJSON` error is returned (I didn't want to introduce a new type of error); if parsing is successful, the provided `eventTime` is converted to milliseconds and passed to the builder.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change does not include tests. No existing tests for websocket messages were found.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes / no)
     - The public API: (`yes` / no)
     - The schema: (yes / no / don't know)
     - The default values of configurations: (yes / no)
     - The wire protocol: (yes / no)
     - The rest endpoints: (yes / no)
     - The admin cli options: (yes / no)
     - Anything that affects deployment: (yes / no / don't know)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (`yes` / no)
     - If yes, how is the feature documented? (not applicable / `docs` / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services