-
Notifications
You must be signed in to change notification settings - Fork 818
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
Fixes #566: NotSerializableException: SessionRegistry$PublishedMessage #568
Fixes #566: NotSerializableException: SessionRegistry$PublishedMessage #568
Conversation
…ishedMessage Instances of implementations of the interface SessionRegistry$EnqueuedMessage are put in the queue, which can be backed by the H2 store. But since this class is not serializable, H2 can not store it. This commit makes the interface serializable, and deals with the non-serializable ByteBuf that the PublishedMessage subclass has as a field.
@hylkevds thanks to point out this problem. I'm thinking if Java serializaion could be avoided, maybe encoding the overall object as a byte array of (topic bytes, q0s byte, message bytes), or maybe a use Protobuf to serialize it; what do you think? |
Long term that's probably a better solution. Is the Serializable a result of the H2 store, or is possible to specify on the H2 store how the serialisation has to happen? |
I think that to use custom deserializer we should:
|
Yes, that should work. Probably also more efficient. |
I agree with your idea, I'll try to put down a draft for this; I would move the fixed length field ( |
Fixes #566
Instances of implementations of the interface
SessionRegistry$EnqueuedMessage are put in the queue, which can be
backed by the H2 store. But since this class is not serializable, H2
can not store it. This commit makes the interface serializable, and
deals with the non-serializable ByteBuf that the PublishedMessage
subclass has as a field.