Siddhant Srivastava
Siddhant Srivastava

Reputation: 102

Using external storage for Vert.x Session Management

Vert.x inbuilt session store LocalSessionStore and ClusteredSessionStoreImpl use local Maps to store session. If I use Redis or any data store for session management i cannot directly serialize them as they don't have properly defined getters and setter. Furthermore, SessionImpl has id as private field with no setters. So even if i have proxy class i cannot re create Session.

How do i store sessions externally then ?

Upvotes: 1

Views: 623

Answers (1)

shiladitya
shiladitya

Reputation: 2310

SessionImpl implements the ClusterSerializable interface, which gives you 2 methods - writeToBuffer and readFromBuffer. You can use them to serialize / deserialize to external stores like redis.

Upvotes: 1

Related Questions