Coder Social home page Coder Social logo

abhirockzz / redis-cdi-example Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 3.0 12 KB

Example for a Java EE CDI producer for Jedis (Redis Java client)

Home Page: https://abhirockzz.wordpress.com/2017/04/14/redis-cdi-example

License: MIT License

Java 95.49% HTML 4.51%
redis javaee7 jedis cdi dependency-injection docker docker-compose

redis-cdi-example's Introduction

Start with Docker Compose

  • git clone https://github.com/abhirockzz/redis-cdi-example.git
  • mvn clean install - creates redis-cdi.war in target dir
  • docker-compose up --build - starts Redis and TomEE containers (you can switch to any other Java EE runtime)

Test

  • docker-machine ip - get the IP address of your Docker host. Let's call it APP_HOST
  • curl -X POST http://<APP_HOST>:8080/redis-cdi/kv/hello -d world - this uses the injected Jedis from the pool to insert a key-value pair in Redis
  • curl -X GET http://<APP_HOST>:8080/redis-cdi/kv/hello - this uses the simple Jedis connection to fetch the value from Redis. You should get world in response (HTTP 200)
  • docker-compose down -v once you're done....

redis-cdi-example's People

Contributors

abhirockzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.