Commit Graph

1086 Commits

Author SHA1 Message Date
Jennifer Hickey
dffa1de6d1 Remove RJC driver due to lack of Redis 2.6 support
DATAREDIS-185
2013-06-11 15:25:01 -07:00
Jennifer Hickey
66139f9fae Wrap native Exceptions in LettuceConnectionFactory
DATAREDIS-191

- Wrap native Exceptions in RedisConnectionFailureExceptions 

- Support switching from shared to non-shared connection
by resetting shared connection in afterPropertiesSet
2013-06-04 11:54:21 -07:00
Greg Turnquist
49dc960ab2 Add alternate constructor to MessageListenerAdapter
As a convenience when configuring with Java, added another constructor
call that allows setting the delegate and the default listener method
in one line of code.

```java
	public MessageListenerAdapter(Object delegate, String defaultListenerMethod) {
		this(delegate);
		setDefaultListenerMethod(defaultListenerMethod);
	}
```

This supports configuring a POJO-based listener with a single step:

```java
	@Test
	public void testCustomMethodWithAlternateConstructor() throws Exception {
		MessageListenerAdapter adapter = new MessageListenerAdapter(target, "customMethod");
		adapter.afterPropertiesSet();

		adapter.onMessage(STRING_MSG, null);

		verify(target).customMethod(PAYLOAD);
	}
```

A pure Java configuration bean can now look like this:
```java
	 @Bean
	 MessageListenerAdapter listenerAdapter(Receiver receiver) {
		 return new new MessageListenerAdapter(receiver, "pojoMethod");
	 }
	 @Bean
	 Receiver receiver() {
		 return new Receiver();
	 }
```
No longer do we have to A) assign the adapter to a variable and B) call
setDefaultListenerMethod, slimming down pure POJO configuration with pure
Java.
2013-05-31 11:16:31 -04:00
Jennifer Hickey
7c8dafce67 Redis timeouts should not be converted to 0
DATAREDIS-176

Only convert timeouts in Redis commands to 0 sec if
the value to convert is 0, otherwise round up to 1
2013-05-30 11:05:03 -07:00
Jennifer Hickey
db7b07788f Fix Lettuce compareAndSet
DATAREDIS-122

- exec() now returns null if value modified by other thread

- Use same connection for watch/unwatch and txs
2013-05-28 13:55:53 -07:00
Jennifer Hickey
39b83cea88 Fix NPE in Lettuce sort 2013-04-17 17:37:39 -07:00
Jennifer Hickey
0c9e8f5054 Fix corrupt subscription connections return to pool
with Redis 2.6

Redis 2.6 responds to unsubscribe requests even if
not subscribed. This results in unread data on the
InputStream on Subscription close if extra 
unsubscribe requests are issued. This causes 
problems if connection is reused 
(as in the case of Jedis pool).

- Only unsubscribe on Subscription close if still
subscribed

-  Use dedicated connection for RJC subscriptions,
as RJC makes extra unsubscribe calls on subscriber
close
2013-04-17 10:03:09 -07:00
Jennifer Hickey
c7555dddff Avoid NPE on LettuceConnectionFactory destroy 2013-04-16 20:14:49 -07:00
Jennifer Hickey
7c96b80e54 Make LettuceConnectionFactory thread-safe 2013-04-15 14:27:28 -07:00
Jennifer Hickey
7d485d6463 Upgrade to SRP 0.5
DATAREDIS-132, DATAREDIS-130, DATAREDIS-152

- Upgrade to fix broken config_get in SRP 0.2

- Fix syntax errors in sort methods

- Fix syntax errors in zRange/zRevRange methods 
with offset and count
2013-04-12 11:01:18 -07:00
Jennifer Hickey
aaa28495be Fix SRP exec not returning results of commands
executed in the tx

DATAREDIS-123

- Close pipeline on exec if not explicitly
opened by user and return results of closePipeline,
not result of exec command

- Close pipeline on discard if not explicitly
opened by user
2013-04-11 15:19:32 -07:00
Jennifer Hickey
7813a13f7a Add option to disable Lettuce connection sharing 2013-04-10 17:34:29 -07:00
Jennifer Hickey
0a702bf4af Share native connection between LettuceConnections
to minimize socket usage

DATAREDIS-126
2013-04-10 15:09:11 -07:00
Jennifer Hickey
f4f9f06356 Fix SRP zRevRangeByScore incorrect parameter ordering
DATAREDIS-167
2013-04-09 17:29:53 -07:00
Jennifer Hickey
f6c44dba78 Fix Lettuce and RJC zRevRangeByScore incorrect parameter ordering
DATAREDIS-167

- Fix min/max parameter ordering

- Fix Lettuce NPEs during transactions

- Fix LettuceConnection not passing offset/count to zRevRangeByScoreWithScores
2013-04-09 17:13:01 -07:00
Jennifer Hickey
a01db2b732 Add back synchronization to avoid corrupted subscription input/output streams
- Prevent simultaneous write of subscribe/unsubscribe using the same Connection

- Fix test failure by re-initializing "done" state of SubscriptionTask between runs and adding waits
2013-04-04 23:29:42 -07:00
Jennifer Hickey
6f1739a681 Fix SubscriptionTask leaving open connections
DATAREDIS-124

- Close connection when SubscriptionTask is canceled and subscribing thread is unblocked

- Ensure non-blocking Lettuce and SRP only attempt
to close subscriptions if active

- Cleanup unecessary synchronization between
SubscriptionTask methods, now that connection is
no longer set to null

- Cleanup unused monitor notify when SubscriptionTask thread ends
2013-04-04 14:59:51 -07:00
Jennifer Hickey
2291edae67 Fix messages not received if listening on channel and pattern
DATAREDIS-165

Infinite loop in PatternSubscriptionTask causing
broken pipes and unreceived messages
2013-04-04 11:27:28 -07:00
Jennifer Hickey
78ad1a7cd4 Fix NPEs and incorrect results in several ops within a Lettuce transaction
DATAREDIS-164
2013-04-02 16:54:48 -07:00
Jennifer Hickey
d34cf27996 Fix Jedis and RJC continuing to use pipeline after closed
DATAREDIS-162, DATAREDIS-163
2013-04-02 15:49:56 -07:00
Jennifer Hickey
c5c3a81f42 Fix Jedis brPop executes twice in a transaction
DATAREDIS-159
2013-04-01 16:45:40 -07:00
Jennifer Hickey
4e13ac5b86 Fix Jedis persist does not execute as part of a transaction
DATAREDIS-160
2013-04-01 16:44:51 -07:00
Jennifer Hickey
8ec6b79e09 Fix JedisConnection execute does not return correct results
DATAREDIS-158
2013-04-01 16:08:38 -07:00
Jennifer Hickey
63a79a4ebb Fix SRP zCount/zInterStore methods executing synchronously when pipelining
DATAREDIS-142
2013-04-01 10:32:12 -07:00
Jennifer Hickey
90affe90cb Fix RJC ping executing synchronously while in pipeline 2013-04-01 10:28:45 -07:00
Jennifer Hickey
a421238403 Fix RJC zRevRangeWithScores returns incorrect results
DATAREDIS-137
2013-04-01 10:27:39 -07:00
Jennifer Hickey
97ebd34b2d Fix Lettuce zCount/zInterStore ops executing synchronously while in pipeline
DATAREDIS-140
2013-04-01 10:22:33 -07:00
Jennifer Hickey
a40555ed19 Fix Lettuce exec to return null when pipelining
DATAREDIS-139
2013-04-01 10:17:19 -07:00
Jennifer Hickey
b3a0deebf8 Fix Jedis dbSize and flush ops executing synchronously while in pipeline or tx
DATAREDIS-141
2013-04-01 10:07:32 -07:00
Jennifer Hickey
fb25e79380 Fix NPE when deserializing a null Map
DATAREDIS-138
2013-04-01 09:53:08 -07:00
Jennifer Hickey
14087cbdc4 Fix SRP continuing to use pipeline after closed
DATAREDIS-157
2013-03-31 11:06:26 -07:00
Jennifer Hickey
a1fb8aad69 Add connection integration tests
- Add tests for all Connection methods

- Add tests for all Connection methods through pipeline

- Clean up DB between Connection test runs

- Reduce sleeps in pub/sub tests to improve execution time
2013-03-30 21:28:51 -07:00
Jennifer Hickey
22e1c9da9b Fix JedisConnection transaction discard
DATAREDIS-135
2013-03-21 18:16:57 -07:00
Jennifer Hickey
57edca0785 Fix Jredis sort to store results under new key
DATAREDIS-135

- Also fix NPE on parsing null getPattern in
DefaultSortParameters
2013-03-21 18:02:56 -07:00
Jennifer Hickey
8553552d2b Fix Lettuce and SRP blpop/brpop issues
- DATAREDIS-127 Fix Lettuce NPE on timeout

- DATAREDIS-128 Fix SRP arg array conversion and NPE
on timeout
2013-03-20 15:07:42 -07:00
Jennifer Hickey
9642b7ea72 Merge branch 'DATAREDIS-117' of github.com:porcelijn/spring-data-redis into porcelijn-DATAREDIS-117
Conflicts:
	src/test/java/org/springframework/data/redis/connection/AbstractConnectionIntegrationTests.java
	src/test/java/org/springframework/data/redis/connection/jedis/JedisConnectionIntegrationTests.java
2013-03-19 09:46:04 -07:00
Tijn Porcelijn
27a7ab0738 Fix for (hash) increment treats long values as int
While the (hash) increment() method accepts a long argument (and Redis
HINCRBY/INCRBY/DECRBY treats arguments as 64 bits), it is cast to a
32bits signed int in the JedisConnection class.

 - Removed offensive (& unnecessary) casts

 - Extended integration tests with incrBy, decrBy and hIncrBy to
   demonstrate handling of large numbers

 - Fixed typos in test support
   (CollectionTestParams, AbstractConnectionIntegrationTests)

Issue: DATAREDIS-117
2013-03-19 11:15:59 +01:00
Jennifer Hickey
a406417efd Fix intermittent SRP Pub/Sub test failures
SRP unsubscribes asynchronously, so occasionally not all messages were delivered prior to unsubscribe. Test will now unsubscribe on connection close instead.
2013-03-14 14:52:44 -07:00
Jennifer Hickey
d46bee7e57 Revert "convertAndSend returns the nr of targeted channels"
- DATAREDIS-118

- Change method return type back to void to fix backwards
compatibility issues

- Modify tests to assert specific clients receive or
don't receive messages vs comparing expected client counts
2013-03-06 16:40:00 -08:00
Costin Leau
5f24495d00 remove invalid javadoc 2013-02-13 17:58:33 +02:00
Costin Leau
cb0f559709 minor optimization to #del() 2013-02-13 17:32:38 +02:00
Costin Leau
74881befe8 make topic impl return their names (easier to dbg) 2013-02-11 17:14:56 +02:00
Costin Leau
570abe6f9c fix incorrect opening of pipeline during multi 2013-02-11 17:13:28 +02:00
Costin Leau
0d7eccc72b add template constructor 2013-02-11 16:01:00 +02:00
Costin Leau
7fbbea0ad3 add missing methods + various pipeline fixes 2013-02-08 18:07:28 +02:00
Costin Leau
75a727537f minor pipeline fix in Jedis 2013-02-08 18:07:02 +02:00
Costin Leau
76a1e01a2d several pipeline bug fixes for Lettuce driver
DATAREDIS-113
2013-02-08 18:06:44 +02:00
Costin Leau
e631af2f2e remove unused code + add NPE fix 2013-02-07 21:30:06 +02:00
Costin Leau
fb9b2215d3 improve unsubscription of channels/patterns in LettuceSub
DATAREDIS-113
2013-02-07 21:26:38 +02:00
Costin Leau
cad7878fa1 properly unsubscribe from channels not patterns on unsub all 2013-02-07 21:17:50 +02:00