From c469abc2a0cdef22b789c7b26ac05f261d21c870 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 2 Apr 2018 13:58:22 +0300 Subject: xmpp: router send s2s to server --- .../src/main/java/com/juick/server/xmpp/router/XMPPRouter.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'juick-server/src/main') 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); } -- cgit v1.2.3