Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

example retrieving redis values as stream in java

Tags:

java

io

redis

jedis

I have a redis key/value store holding blobs (size in the tens of MB), and the jedis client I am using in my java application returns a byte array from the jedis connection's get method. Currently, I have to wrap the result in a stream in order to process the bytes. Are there any alternatives that would allow me to stream the result directly? other clients or ways to use Jedsi? thanks for any advice.

like image 839
brendon Avatar asked Aug 22 '14 03:08

brendon


1 Answers

If you don't find any available existing driver to perform what you like, You can calling directly redis from your java code.

The protocol used by a redis server, RESP (REdis Serialization Protocol) is very simple. I studied it and implemented a complete java driver, just to test my abilities in less than half day. Here is the link to RESP specification. You can for example start from an existing driver and add a custom functionality to stream the data as you like.

like image 163
Davide Lorenzo MARINO Avatar answered Oct 01 '22 03:10

Davide Lorenzo MARINO