This example shows how to use Redis as data storage.
As for other examples, it implements BookingService
using Redis as storage.
BookingService
interface and Booking
POJO.BookingService
using Redis as storage.BookingService
.The build uses Apache Maven. Simply use:
$ mvn clean install
On a running Karaf instance, register the features repository using:
karaf@root()> feature:repo-add mvn:org.apache.karaf.examples/karaf-example-redis-features/LATEST/xml
Then you can install the Redis service and command features:
karaf@root()> feature:install karaf-example-redis-service karaf@root()> feature:install karaf-example-redis-command
Once you have installed the features, you can see new commands available in the Apache Karaf shell.
booking:add
command adds a new booking in the booking service. For instance:
karaf@root()> booking:add Doe AF520
booking:list
command lists the current bookings:
karaf@root()> booking:list ID │ Flight │ Customer ────────┼────────┼───────── 1 │ AF520 │ Doe