Commit Graph

1222 Commits

Author SHA1 Message Date
Mark Paluch
8357c7d88b Polishing.
Revise builder. Accept builder components in builder methods instead of the builder factory method. Enforce valid parameters instead of lenient, potentially null parameters.

Introduce configuration means to control default typing. Extend tests.

See #2878
Original pull request: #2905
2024-05-21 14:56:17 +02:00
annemayor
33326aa2db Allow configuring custom NullValueSerializer.
Closes #2878
Original pull request: #2905
2024-05-21 14:56:17 +02:00
Mark Paluch
7ca2779ea5 Polishing.
Reformat code.
2024-05-13 15:10:04 +02:00
Roman Osadchuk
2809186e4d Use correct bitfield offset for INCRBY using Lettuce.
Closes #2903
Original pull request: #2901
2024-05-13 15:09:41 +02:00
Mark Paluch
3ab09fbd57 Polishing.
Refine unlocking by checking whether the lock was actually applied.

Reduce allocations, refine test assertions to check for concurrency.

See #1686
Original pull request: #2879
2024-04-19 08:57:32 +02:00
Chan Young
c980407f7d Improve atomicity in DefaultRedisCacheWriter.doLock().
Closes #1686
Original pull request: #2879
2024-04-19 08:57:28 +02:00
Christoph Strobl
7fad17a1de Resolve element type from NodeType before falling back to reflection when reading values from JsonNode.
This commit changes the node value retrieval so that it first tries to determine the node type before falling back to reflective access of the _value field.

Closes #2838
Original pull request: #2842
2024-04-19 08:22:35 +02:00
Mark Paluch
2f34f63e28 Polishing.
Reduce allocations by reusing IndexDefinition in RemoveIndexedData.

Tweak test method name.

See #2882
Original pull request: #2895
2024-04-19 08:17:47 +02:00
Christoph Strobl
8afabc1fe3 Clear indexed data if property value is set to null.
Closes #2882
Original pull request: #2895
2024-04-19 08:17:41 +02:00
Mark Paluch
9cad17171e Let QueryByExampleRedisExecutor implement ListQueryByExampleExecutor.
Closes #2880
2024-04-16 10:07:30 +02:00
Mark Paluch
4c8941df6b Refine ReactiveRedisOperations#listenTo and listenTo…Later Javadoc mentioning resource usage.
Closes #2229
2024-04-16 09:54:53 +02:00
Mark Paluch
7a94beb467 Allow RedisConnectionFactories to be initialized as part of the context lifecycle.
Lettuce and Jedis connection factories now can be configured to initialize early during afterPropertiesSet or configured whether the component should be auto-started by the container.

By default, connection factories auto-startup early.

Closes #2866
Original Pull Request: #2868
2024-04-11 15:34:05 +02:00
Christoph Strobl
779a0126e5 Polishing.
Avoid duplicate method lookup by keeping reference to Method.
Add missing native image hints for command proxies.

Original Pull Request: #2887
2024-04-11 13:35:27 +02:00
Mark Paluch
eed4c2af40 Consider intermediate command interface in ConnectionSplittingInterceptor.
We now consider requests to command API objects such as RedisConnection.keyCommands() in ConnectionSplittingInterceptor to identify the correct command and route it accordingly.

Closes: #2886
Original Pull Request: #2887
2024-04-11 13:31:58 +02:00
Mark Paluch
6f28b530b0 Use Lettuce functionality for Cluster commands where possible.
We now remove our own code in favor of Lettuce's advanced cluster support to leverage asynchronous functionality in pipelining.

Document pipelining restrictions regarding Redis Cluster.

Original Pull Request: #2889
2024-04-10 16:05:56 +02:00
Mark Paluch
d785b5f870 Accept CompletableFuture subtypes for Lettuce pipelining.
We now no longer require RedisCommand but resort to CompletableFuture as the general asynchronous result type for Lettuce pipelining to allow subtypes such as PipelinedRedisFuture.

Closes: #2888
Original Pull Request: #2889
2024-04-10 14:41:06 +02:00
Mark Paluch
761115ab37 Polishing.
Deprecate RedisSentinelConfiguration and RedisClusterConfiguration constructors taking PropertySource in favor of a factory method.

Reformat code. Update documentation.

See #2860
Original pull request: #2861
2024-03-01 14:10:31 +01:00
Mustapha Zorgati
f9a763e55a Extend properties for RedisSentinelConfiguration.
Closes #2860
Original pull request: #2861

Co-authored-by: Samuel Klose <39386136+samKl99@users.noreply.github.com>
2024-03-01 14:10:23 +01:00
Mark Paluch
9543076752 Add support for DTO projections.
See: #2851
Original Pull Request: #2854
2024-02-23 10:38:15 +01:00
Mark Paluch
3c44521026 Use by-id lookup for queries referring to identifier values.
Closes: #2851
Original Pull Request: #2854
2024-02-23 10:36:22 +01:00
Mark Paluch
4da3169a0b Encapsulate Redis Scan CursorId.
We now retain the raw cursor value without attempting to convert it into a long as Redis uses 64 bit unsigned integers exceeding Long.MAX_VALUE.
Fix broken id parsing for unsigned long value
Update deprecation warnings and method visibility.

See: #2796
Closes: #2802
2024-02-07 15:43:16 +01:00
Mark Paluch
aa7045ab95 Remove redundant assertion from RedisTemplate.afterPropertiesSet(…).
Closes #2832
2024-01-19 09:35:32 +01:00
Mark Paluch
25a6981544 Polishing.
Reformat code.

See #2831
2024-01-18 11:01:27 +01:00
Mark Paluch
75e51f5b39 Deprecate LettuceConnectionFactory.setDatabase(…) in alignment with JedisConnectionFactory.setDatabase(…)
See #2831
2024-01-18 11:01:26 +01:00
Mark Paluch
707184f7e2 Update deprecation description of JedisConnectionFactory.setDatabase(…).
Mention database index instead of client name.

Closes #2831
2024-01-18 11:01:26 +01:00
Mark Paluch
b6e4951345 Polishing.
Add missing property editors to inject requested operations.

See #2828
2024-01-11 14:46:27 +01:00
Mark Paluch
7f48b752eb Extend license header copyright years to 2024.
See #2821
2024-01-02 14:42:07 +01:00
Mark Paluch
2e29a999f8 Differentiate between initial exception handling, recovery and recovery after subscription.
We now differentiate exception handling regarding the recovery state. Initial listen fails if the connection is unavailable. Upon recovery after a preceeding subscription we now log the success to create a counterpart to our error logging.

Closes: #2782
Original Pull Request: #2808
2023-12-15 11:13:37 +01:00
Christoph Strobl
1c8cc73edc Polishing.
Delegate value loading to existing method to remove duplicate code paths.

Original Pull Request: #2785
2023-12-13 16:25:32 +01:00
Mark Paluch
a2af06d6fd Polishing.
Reformat code.

Original Pull Request: #2785
2023-12-13 16:25:18 +01:00
Mark Paluch
97e9a1d18b Expose ValueWrapper to differentiate between cached null values and absent cache mapping.
We now use ValueWrapper to differentiate in the async API between cache misses and cached null values.

Closes: #2783
Original Pull Request: #2785
2023-12-13 16:24:55 +01:00
Christoph Strobl
c19acb0b45 Add tests to verify symmetric usage of scan cursor id.
See: #2796
2023-12-13 14:49:12 +01:00
Mark Paluch
b9f2e4c509 Use Long.parseUnsignedLong/toUnsignedString for SCAN cursor id parsing.
Redis uses an unsigned 64bit value for its cursor id which is now captured via parseUnsignedLong.

Closes: #2796
2023-12-13 14:40:55 +01:00
Mark Paluch
966dc05704 Polishing.
Fix Javadoc reference.

See #2778
2023-12-13 09:10:29 +01:00
Mark Paluch
5a2a92a221 Remove duplicate keys from RedisQueryEngine.
We now avoid duplicate keys if a key is found in two indices.

Closes #2799
2023-12-11 10:31:09 +01:00
Junghoon Ban
3ad3874219 Refine getRequiredAdapter()usage in RedisQueryEngine.
We now use getRequiredAdapter() instead of getAdapter() to enforce either an object or a proper exception.

Closes #2800
Original pull request: #2801
2023-12-11 10:11:59 +01:00
Mark Paluch
bcf761f0f7 Accept empty config values in the Lettuce connection wrapper.
Closes #2798
2023-12-08 14:56:57 +01:00
John Blum
76cdf48afa Polishing.
Rename asString(:Object) to toString(:Object) for consistency with toBytes(..).

Original pull request: #2774
2023-11-17 15:05:09 -08:00
Junghoon Ban
482eab9224 Remove unnecessary method call in RedisKeyValueAdapter.
Closes #2774
2023-11-17 15:04:56 -08:00
Junghoon Ban
22a465a992 Polishing.
Use module identifier instead of constant.

Closes #2762
2023-11-06 10:55:28 +01:00
Mark Paluch
f97bd87d70 Upgrade to Jedis 5.0.2.
Closes #2763
2023-11-06 09:41:08 +01:00
Mark Paluch
667dd27bb5 Polishing.
Tweak naming. Simplify converters by removing unused methods.

See #2754
2023-10-27 15:00:20 +02:00
Junghoon Ban
85e9ae50ff Use pattern matching instead of type casting.
Closes #2754
2023-10-27 15:00:14 +02:00
John Blum
f28bf61142 Safely add and register the MessageListener to Topic mapping.
Given addListener(:MessageListener, :Collection<Topic>) could be called concurrently from the addMessageListener(:MessageListener, Collection<Topic>) method by multiple Threads, and the RedisMessageListenerContainer Javadoc specifically states that it is safe to call the addMessageListener(..) method conurrently without any external synchronization, and the registeration (or mapping) of listener to Topics is a componund action, then a race condition is possible.

Closes #2755
2023-10-23 12:18:57 -07:00
John Blum
f56989f9c1 Apply consistent Exception variable names to all catch blocks.
We now consistently align with the core Spring Framework's use of 'ex' as the variable name for Exceptions handled in catch blocks, and 'ignore' for all Exceptions thrown, but ignored by framework code. Both 'ex' and 'ignore' were appropriately used based on the context and nautre of the Exception handler in the catch block.

Additionally, we use the 'expected' variable name for Exception thrown in tests where the thrown Exception is the expected outcome of the test case.

Only 1 exception exists to these name conventions, and that is 'nested', which was necessarily used in ScanCursor due to the nested try-catch blocks.

Applied consistent use of String.format(..) to Exception messages requiring formatting.

Formatted catch block according to source code formatting style.

Closes #2748
Original pull request: #2749
2023-10-19 09:38:35 +02:00
John Blum
68f514bdd8 Refine initialization of the TypeResolver in GenericJackson2JsonRedisSerializer.
Closes #2750
2023-10-18 22:27:13 -07:00
John Blum
12f5fad1ba Cleanup equals(:Object) method and compiler warnings in RedisSentinelConfiguration.
Additionally:

* Annotates getMaster() with @Nullable.
* Fixes assertion messages for accuracy and consistency.
* Introduces white spacing for readability.

Closes #2747
2023-10-18 16:32:05 -07:00
John Blum
a71f042ec4 Refine Javadoc and source in caching infrastructure components.
Judiciously applies minor source code refinements, such as introducing named (local) variable object references to make it clearer the arguments that are being passed to caching method parameters, in favor of self-describing code with intent.

Closes #2742
2023-10-17 20:02:56 -07:00
Mark Paluch
917632bd32 Polishing.
Add since tag. Reformat code.

See #2601
2023-10-13 10:36:26 +02:00
Mark Paluch
efc9ecf695 Polishing.
Replace blocking lock wait with non-blocking flow. Add support for asynchronous storage to persist the cache value after retrieval from the value supplier. Introduce AsyncCacheWriter abstraction to improve functional guards.

Reformat code. Remove redundant tests. Revisit deprecation notices with consistent mention of the version in which the deprecation was introduced.

Refine exception messages when RedisCache does not support async retrieval.

See #2650
Original pull request: #2717
2023-10-13 09:31:50 +02:00