Created
June 12, 2018 14:26
-
-
Save oli-h/74da431cc2919771f6b5cba8fd7dba7f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ch.post.it.paisa.houston.process.main; | |
| import io.vertx.core.Vertx; | |
| import io.vertx.redis.RedisClient; | |
| import io.vertx.redis.RedisOptions; | |
| public class OliVerticle { | |
| public static void main(String[] args) throws Exception { | |
| Vertx vertx = Vertx.vertx(); | |
| RedisOptions redisOptions = new RedisOptions() | |
| .setHost("127.0.0.1") | |
| .setPort(6389) | |
| .setAuth("isarulez"); | |
| RedisClient redisClient = RedisClient.create(vertx, redisOptions); | |
| while (true) { | |
| System.out.println("Issue Redis command"); | |
| redisClient.info(infoResult -> { | |
| String serverVersion = infoResult.result().getJsonObject("server").getString("redis_version"); | |
| if (infoResult.succeeded()) { | |
| System.out.println("Yes " + serverVersion); | |
| } else { | |
| System.out.println("Oh no " + infoResult.cause()); | |
| } | |
| }); | |
| Thread.sleep(500); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment