diff options
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/xmpp')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/juick-server/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java b/juick-server/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java index 670962de..e5900977 100644 --- a/juick-server/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java +++ b/juick-server/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java @@ -1,5 +1,6 @@ package com.juick.server.xmpp.router; +import com.juick.server.XMPPServer; import com.juick.server.xmpp.s2s.BasicXmppSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,10 +47,12 @@ public class XMPPRouter implements StreamHandler { @Value("${router_port:5347}") private int routerPort; - @PostConstruct - public void init() { + private XMPPServer xmppServer; + @Inject + public XMPPRouter(XMPPServer xmppServer) { logger.info("component router initialized"); + this.xmppServer = xmppServer; service.submit(() -> { try { listener = new ServerSocket(routerPort); @@ -134,7 +137,7 @@ public class XMPPRouter implements StreamHandler { connOut.send(xml); return; } - logger.error("component unavailable: {}", hostname); + xmppServer.sendOut(Jid.of(hostname), xml); } |