private Mono<Void> saveChangeSessionId() { if (!hasChangedSessionId()) { return Mono.empty(); } String sessionId = getId(); Publisher<Void> replaceSessionId = (s) -> { this.originalSessionId = sessionId; s.onComplete(); }; if (this.isNew) { return Mono.from(replaceSessionId); } else { String originalSessionKey = getSessionKey(this.originalSessionId); String sessionKey = getSessionKey(sessionId); return ReactiveRedisOperationsSessionRepository.this.sessionRedisOperations .rename(originalSessionKey, sessionKey).and(replaceSessionId); } }