{"id":29291104,"url":"https://github.com/networknt/light-session-4j","last_synced_at":"2025-07-06T07:34:23.632Z","repository":{"id":25488903,"uuid":"104141049","full_name":"networknt/light-session-4j","owner":"networknt","description":"Distributed session managers (Redis, Hazelcast, JDBC) that support web server cluster for light-4j framework","archived":false,"fork":false,"pushed_at":"2025-06-25T18:47:11.000Z","size":665,"stargazers_count":8,"open_issues_count":1,"forks_count":3,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-06-25T19:16:18.415Z","etag":null,"topics":["distributed","hazelcast","jdbc","redis","session","session-management"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/networknt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-09-19T23:38:40.000Z","updated_at":"2025-06-25T18:47:15.000Z","dependencies_parsed_at":"2023-02-19T12:20:28.218Z","dependency_job_id":"c484643f-5490-4e1b-9a3a-e962fbf01d87","html_url":"https://github.com/networknt/light-session-4j","commit_stats":null,"previous_names":[],"tags_count":131,"template":false,"template_full_name":null,"purl":"pkg:github/networknt/light-session-4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Flight-session-4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Flight-session-4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Flight-session-4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Flight-session-4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/networknt","download_url":"https://codeload.github.com/networknt/light-session-4j/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networknt%2Flight-session-4j/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261960380,"owners_count":23236552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distributed","hazelcast","jdbc","redis","session","session-management"],"created_at":"2025-07-06T07:34:21.545Z","updated_at":"2025-07-06T07:34:23.624Z","avatar_url":"https://github.com/networknt.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# light-session\n\n[Stack Overflow](https://stackoverflow.com/questions/tagged/light-4j) |\n[Google Group](https://groups.google.com/forum/#!forum/light-4j) |\n[Gitter Chat](https://gitter.im/networknt/light-4j) |\n[Subreddit](https://www.reddit.com/r/lightapi/) |\n[Youtube Channel](https://www.youtube.com/channel/UCHCRMWJVXw8iB7zKxF55Byw) |\n[Documentation](https://doc.networknt.com/style/light-session-4j/) |\n[Contribution Guide](https://doc.networknt.com/contribute/) |\n\nlight-4j framework build upon undertow server. Undertow manager session in single node module and doesn't support distributed session management.\n\nLight-session aims to provide a common infrastructure for managing sessions in distributed environment.\n\nLight-session provide different types of repository for distributed session management which include Hazelcast, JDBD and Redis.\n\n## Project module:\n\nsession-core           --- core components and interfaces for the session management. It should be included any type of repository. And this module also provide in memory session manager for single node.\n\n\nhazelcast-mananger     --- use hazelcast as repository for session management. Session will be persisted in the hazelcast distributed cache repository.\n\njdbc-manager           --- use RDBMS database as repository for session management. Session will be persisted in the database tables.\n\nredis-manager          --- use redis as repository for session management. Session will be persisted in the redis in-memory data structure store.\n\n\n## In memory session manager:\n\nIn memory session manager provided in the session-core module. System use the Caffeine as in memory cache to store the session:\n\nhttps://github.com/ben-manes/caffeine\n\nIn server.yml file:\n\n```\n- com.networknt.session.SessionManager:\n  - com.networknt.session.MapSessionManager\n```\n\n\n## Hazelcast session manager\n\n System use the Hazelcast as distributed cache repository to store the session:\n\nIn server.yml file:\n\n```\n- com.networknt.session.SessionManager:\n  - com.networknt.session.hazelcast.HazelcastSessionManager\n```\n\n\n## JDBC session manager\n\nSystem provide two set of DDL script, one for Oracle, another for postgres. User need create the tables in the database before use the session management:\n\nIn server.yml file:\n\n```\n- com.networknt.session.SessionManager:\n   - com.networknt.session.jdbc.JdbcSessionManager\n```\n\n\nBelow is the sample for the script:\n\n```\nDROP table IF EXISTS light_session;\nDROP table IF EXISTS light_session_attributes;\n\n\n CREATE TABLE light_session (\n    session_id VARCHAR2(100) NOT NULL,\n    creation_time bigint NOT NULL,\n    last_access_time bigint NOT NULL,\n    max_inactive_interval int,\n    expiry_time bigint,\n    principal_name VARCHAR(100),\n    PRIMARY KEY(session_id)\n  );\n\n\n\n\n  CREATE TABLE light_session_attributes (\n   session_id VARCHAR2(100) NOT NULL,\n   attribute_name VARCHAR(200) NOT NULL,\n   attribute_bytes BYTEA,\n   PRIMARY KEY(session_id, attribute_name)\n  );\n```\n\n\n\n## Redis session manager\n\nIn server.yml file:\n\n```\n- com.networknt.session.SessionManager:\n  - com.networknt.session.redis.RedisSessionManager\n```\n\nUser need start redis server before build and test the application\n\n## Start Redis docker image:\n\ndocker run --name some-redis -p 6379:6379 -d redis redis-server --appendonly yes\n\n## Start redis bash:\n\ndocker exec -it some-redis bash\n\n## test connection:\n\n/data# redis-cli ping\n\nResult should be: PONG\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworknt%2Flight-session-4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetworknt%2Flight-session-4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworknt%2Flight-session-4j/lists"}