Skip to content

Commit a28b4be

Browse files
[Java] Add redis sessionmap doc (#8543)
Co-authored-by: David Burns <david.burns@theautomatedtester.co.uk>
1 parent c14a537 commit a28b4be

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

java/server/src/org/openqa/selenium/grid/commands/InfoCommand.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ public Executable configure(PrintStream out, PrintStream err, String... args) {
100100
toDisplay = "tracing.txt";
101101
break;
102102

103+
case "sessionmap":
104+
title = "About SessionMaps";
105+
toDisplay = "sessionmaps.txt";
106+
break;
107+
103108
case "help":
104109
case "info":
105110
default:

java/server/src/org/openqa/selenium/grid/commands/info.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ the "info" command followed by:
44
* config - Help on how to configure Selenium
55
* tracing - Help on how distributed tracing works with selenium
66
* security - Help on how how to secure communications to and within selenium
7+
* sessionmap - Help on different types of sessionmap and how to start them.
78

89
Each topic will give you enough information to help you get started, and
910
contains some pointers on our site to provide more complete information.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Selenium 4 Grid ships with SessionMap.
2+
3+
A SessionMap is a store of session id and it's capabilities.
4+
It is a key value store. Now, how that data is stored differs
5+
on the implementation used. As of Selenium 4, we offer the
6+
following types of data store.
7+
8+
1. RedisBackedSessionMap
9+
========================
10+
11+
`RedisBackedSessionMap` uses Redis as datastore for key, value store.
12+
Below are the steps to start a `RedisBackedSessionMap`.
13+
14+
1. Set an environment variable using `export SESSIONS_IMPLEMENTATION='org.openqa.selenium.grid.sessionmap.redis.RedisBackedSessionMap'`
15+
2. Set scheme to redis using `export SESSIONS_SCHEME="redis"`
16+
3. Download the redis-session-map jar from MVN respository.
17+
4. Start the RedisBackedSessionMap using the command
18+
`java -jar <path/to/grid/jar> --ext $(coursier fetch -p io.lettuce:lettuce-core:<latest release>): path/to/redis-session-map.jar sessions --sessions-host "<redis_host>" --sessions-port <redis_port>`
19+
20+
After the sessionmap server successfully starts, you should see some log lines as below:
21+
```
22+
15:22:54.247 INFO [LoggingOptions.getTracer] - Using OpenTelemetry for tracing
23+
15:22:54.249 INFO [LoggingOptions.createTracer] - Using OpenTelemetry for tracing
24+
15:22:54.827 INFO [EpollProvider.<clinit>] - Starting without optional epoll library
25+
15:22:55.136 INFO [KqueueProvider.<clinit>] - Starting with kqueue library
26+
15:22:55.328 INFO [SessionMapServer.execute] - Started Selenium session map 4.0.0-alpha-7 (revision a5536dfb7b*): http://192.168.0.5:5556
27+
```

0 commit comments

Comments
 (0)