https://github.com/vpavic/samples-spring-session
Samples: Spring Session
https://github.com/vpavic/samples-spring-session
hazelcast java jdbc mongodb redis samples spring-boot spring-framework spring-session
Last synced: 5 months ago
JSON representation
Samples: Spring Session
- Host: GitHub
- URL: https://github.com/vpavic/samples-spring-session
- Owner: vpavic
- License: apache-2.0
- Created: 2018-04-18T09:00:00.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-29T11:37:30.000Z (about 2 years ago)
- Last Synced: 2024-04-29T12:46:07.298Z (about 2 years ago)
- Topics: hazelcast, java, jdbc, mongodb, redis, samples, spring-boot, spring-framework, spring-session
- Language: Java
- Homepage:
- Size: 675 KB
- Stars: 2
- Watchers: 3
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE.txt
Awesome Lists containing this project
README
= Samples: Spring Session
image:https://github.com/vpavic/samples-spring-session/actions/workflows/build.yml/badge.svg["Build", link="https://github.com/vpavic/samples-spring-session/actions/workflows/build.yml"]
This repository contains sample applications that showcase basic Spring Session functionalities across different web stacks and data stores.
The name of each sample application contains the web stack integration it's based on, and the data store is uses to store sessions.
Below is the list of all the provided sample applications:
* HttpSession
** Redis
** JDBC
** Hazelcast
** MongoDB
** Infinispan (3rd party integration)
* WebSession
** Redis
** MongoDB
== Getting Started
=== Requirements
Java 17 is required to run the samples.
The project is built using Gradle and uses https://docs.gradle.org/current/userguide/gradle_wrapper.html[Gradle Wrapper] to take care of downloading the appropriate Gradle version.
=== Running the Samples
Each sample is a Spring Boot based application that can be run using:
* using the `bootRun` task of the appropriate sample application
* from your IDE by running sample application's main class
By default, all samples start web server on port `8080`.
==== HttpSession Redis
[source,sh]
----
$ ./gradlew :sample-httpsession-redis:bootRun
----
By default, this sample will attempt to connect to Redis running locally at port `6379`.
==== HttpSession JDBC
[source,sh]
----
$ ./gradlew :sample-httpsession-jdbc:bootRun
----
By default, this sample will attempt to connect to PostgreSQL running locally at port `5432` using database `spring_session`, username `spring_session` and password `spring_session`.
The project contains the JDBC driver for the following RDMBSs:
* DB2
* MariaDB
* MySQL
* Oracle
* PostgreSQL
* SQL Server
==== HttpSession Hazelcast
[source,sh]
----
$ ./gradlew :sample-httpsession-hazelcast:bootRun
----
By default, this sample will start an embedded Hazelcast instance.
==== HttpSession Infinispan
[source,sh]
----
$ ./gradlew :sample-httpsession-infinispan:bootRun
----
By default, this sample will start an embedded Infinispan instance.
==== HttpSession MongoDB
[source,sh]
----
$ ./gradlew :sample-httpsession-mongodb:bootRun
----
By default, this sample will attempt to connect to MongoDB running locally at port `27017`.
==== WebSession Redis
[source,sh]
----
$ ./gradlew :sample-websession-redis:bootRun
----
By default, this sample will attempt to connect to Redis running locally at port `6379`.
==== WebSession MongoDB
[source,sh]
----
$ ./gradlew :sample-websession-mongodb:bootRun
----
By default, this sample will attempt to connect to MongoDB running locally at port `27017`.
=== Building from Source
To build the project from source, you will need to have Docker installed.
To project can be built the `build` task:
[source,sh]
----
$ ./gradlew build
----