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

Introduce a listener for JSON events #832

sbordet opened this Issue Feb 20, 2019 · 1 comment


None yet
1 participant
Copy link

sbordet commented Feb 20, 2019

The first use case is when a client sends a message and may want to limit the size of the message being sent.
This listener would need to be called after all transformations that extensions may do to the message.
Furthermore, the JSON generation must be done once, so that applications can interact with the JSON without the need to generate the JSON a second time which would waste resources.


This comment has been minimized.

Copy link
Member Author

sbordet commented Feb 20, 2019

It may be interesting to emit an event for the incoming JSON (on both client and server) before it is converted to a message object.
However, this would require to accumulate the JSON into a String, while currently we can parse the JSON using a Reader with much less impact on memory.

On server side another event may be emitted when the message is frozen, so that applications will be able to e.g. log the message length in bytes.

@sbordet sbordet changed the title Introduce a listener to handle JSON generation Introduce a listener for JSON events Feb 20, 2019

@sbordet sbordet added the enhancement label Feb 20, 2019

@sbordet sbordet added this to the 4.0.4 milestone Feb 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.