Example project of Spring Data for Redis, in-memory data structure store.
Redis data are stored with Camel RSS component (Available as of Camel version 2.0), getting a news feed.
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries.
Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.
In this example we use Redis as a sever database in standalone mode.
Lettuce is a fully non-blocking Redis client built with netty providing Reactive, Asynchronous and Synchronous Data Access.
This example is building with Lettuce 3: a scalable thread-safe Java RedisClient providing both synchronous and asynchronous connections for server.
Lettuce connections are designed to be thread-safe so one connection can be shared amongst multiple threads and Lettuce connections auto-reconnection by default. While connection pooling is not necessary in most cases it can be helpful in certain use cases.
So, you won't find any connection pool configuration in this repository.
The rss component is used for polling RSS feeds in several threads from CNN news channel.
Camel will default poll the feed every 60th seconds.
The component currently only supports polling (consuming) feeds.
Camel-rss internally uses a patched version of ROME hosted on ServiceMix to solve some OSGi class loading issues.
You will need following to run this application:
As first step you will need to install and start a Redis DB.
In this project client's configuration is done for a running local Redis server.
After that you can start this application using maven: just typing:
mvn camel:run
Once feed's consumer is started Redis data are stored as Sets type in XML format.
Note 1: This is a console app
Note 2: Please be aware that, each time the process is started, all data are evicted from Redis
Note 3: You can stop Camel Consumer just typing 'Ctrl+C' at Terminal
- David Jiménez Anca : https://twitter.com/davidjimenezanc
- mailto: dvdancca@gmail.com
- Upwork profile: https://www.upwork.com/fl/davidjimenez3