Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2203

Connection refused when subscribing to port using the Jedis message broker

$
0
0

I've been trying to subscribe to a port using redis's message broker on my localhost. I'm using the jedis api for this.

When I try to connect, I keep getting the error connection refused. I tried 5 different ports that should be free, and I tried using both "localhost" and "0.0.0.0" for the hostname.

This is what I tried:

private static final int PORT = 25564;private static final String HOST = "0.0.0.0";private Jedis jedis = new Jedis(HOST,PORT);private JedisPubSub arenaEventHandler = new JedisPubSub() {     @Override     public void onMessage(String channel, String message) {         getLogger().info("received message on " + channel +": " + message);     }};private void setupArenaSubscription(){    getProxy().getScheduler().runAsync(this, () -> {        try {            jedis.psubscribe(arenaEventHandler, "ARENA*");            getLogger().info("Subscription ended.");        } catch (Exception e) {            getLogger().log(Level.SEVERE,"Subscribing failed.", e);        }    });}

As you can see I'm also using the BungeeCord api, but this shouldn't be influencing the connection.

The error is occuring in the try-catch-block when I call pSubscribe. I hope that anyone can help me with this issue.


Viewing all articles
Browse latest Browse all 2203

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>