I'm porting my current project from Jedis to Lettuce.
Is it ok to use shared connection for reactive API? As long as I don't invoke blocking and transactional operations such as BLPOP and MULTI/EXEC?
Should I use pooled connections for transactions through reactive API?
Is it possible to pipeline commands through reactive API? Should I use dedicated connection for that?
Sharing one connection amongst multiple threads is the intended usage. There are multiple reasons:
Regarding pipelining: lettuce does not await command completion before sending subsequent commands to Redis which means lettuce uses pipelining by default. The only way to prevent pipelining is outside synchronization on command invocation.
Each command is flushed directly to the TCP connection. Lettuce can use batching to group commands before flushing them to the connection. Command flushing is a manual thing and more intended for bulk loading and not for reactive use.
There are two more things:
HTH,
Mark