Wowza Community

Connect to Redis (Jedis)

Is there a reason I cannot connect to Redis from a Trial Wowza Streaming Engine? Is there some kind of limitation?

The code below simply hangs and nothing gets logged except for the server initialisation logs.

Removing all Redis related code fixes the issue.

public class ModuleListenWebRTCSession extends ModuleBase{	
	public JedisPool pool = null;

	public void onAppStart(IApplicationInstance appInstance) {

	    getLogger().info("[APP] Running"); //does not show in accesslog

	    this.pool = new JedisPool(new JedisPoolConfig(), "localhost");
	   
	    try (Jedis jedis = pool.getResource()) {
	    	  jedis.set("foo", "bar");
	    	  String foobar = jedis.get("foo");
	    	  getLogger().info("Got foobar: " + foobar);	 
	    }
	    catch (Exception e){
	    	getLogger().error(e.getMessage());

	    }
      }
} 

There are no wowza trial limitations that would cause this. Did you upload the jedis library to your server? A missing class would cause the module to hang as you described.

Doh, thanks! That was actually the issue. My Java skills are quite limited. I was under the assumption that the JAR I’m exporting from Eclipse already has the Jedis dependency in it.