Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify the json decoder to support json array when looking for a timestamp #5

Conversation

leezhang
Copy link

@krishnap @ericlevine
Modify the json decoder to support json array when looking for a timestamp
Currently jitney message is in this format
[{"eventType":"session-activity","id":"ae86fa9d-0332-4fb1-9560-4d020bd2eec2"...},{"sessionActivity":{"userId":1,"activityType":"test_activity","sessionId":"session_id"},"eventType":"session-activity"}]
basically an array of 2 json objects, the first one is the jitney meta data and the second one is the session activity payload, the current code is assuming the message is a json object per message and need to updated to support JSONArray

@krishnap
Copy link

nothing wrong with this code, but could we write a new class JitneyTimestampDecoder and have your code there please? You could refer to the class used in the properties file.

We have a project ongoing where we are writing some DI classes to work with Jitney. the idea of picking a timestamp field by walking down the array may not be the best for that. not sure yet, the story there is evolving, so it seems better to keep this class unchanged.

@leezhang
Copy link
Author

@krishnap cool, I've copied the file over into JitneyTimestampDecoder and adjusted the documentation accordingly

@krishnap
Copy link

👍

@krishnap
Copy link

@airbnb/di FYI

@krishnap
Copy link

merging for @leezhang upon his request.

krishnap added a commit that referenced this pull request Apr 21, 2015
…g_message_decoder

modify the json decoder to support json array when looking for a timestamp
@krishnap krishnap merged commit 7754866 into airbnb:master Apr 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants