package org.mmog2048.verticles;

import io.vertx.core.AbstractVerticle;
import io.vertx.core.Future;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import redis.embedded.RedisServer;

import java.io.IOException;

public class EmbeddedRedis extends AbstractVerticle {
    private static final Logger log = LoggerFactory.getLogger(EmbeddedRedis.class);
    private RedisServer server;

    @Override
    public void start(Future<Void> future) {
        try {
            server = new RedisServer(MainVerticle.REDIS_PORT);
            server.start(); // seems to be blocking
            log.info("Redis started on " + MainVerticle.REDIS_PORT);
            future.complete();
        } catch (IOException ioe) {
            log.error(ioe.getMessage(),ioe);
            future.fail(ioe);
        }
    }

    @Override
    public void stop(Future<Void> future) {
        if (server != null) {
            server.stop();
            server = null;
        }
        future.complete();
    }
}

@@ -214,35 +214,48 @@
 er;%0A
-%0A
 import 
-java.io.IOException
+redis.embedded.RedisServerBuilder
 ;%0A%0Ap
@@ -339,19 +339,19 @@
  Logger 
-log
+LOG
  = Logge
@@ -391,16 +391,92 @@
 class);%0A
+    private static String OS = System.getProperty(%22os.name%22).toLowerCase();%0A
     priv
@@ -589,56 +589,319 @@
     
-server = new RedisServer(MainVerticle.REDIS_PORT
+RedisServerBuilder builder = RedisServer.builder()%0A                    .port(MainVerticle.REDIS_PORT);%0A            if(isWindows()) %7B%0A                // https://github.com/kstyrc/embedded-redis/issues/52%0A                builder = builder.setting(%22maxheap 512M%22);%0A            %7D%0A            server = builder.build(
 );%0A 
@@ -963,19 +963,19 @@
         
-log
+LOG
 .info(%22R
@@ -1072,10 +1072,8 @@
 ch (
-IO
 Exce
@@ -1097,19 +1097,19 @@
         
-log
+LOG
 .error(i
@@ -1361,11 +1361,93 @@
 );%0A    %7D
+%0A%0A    private boolean isWindows() %7B%0A        return (OS.indexOf(%22win%22) %3E= 0);%0A    %7D
 %0A%7D%0A

fix issue running on Windows