diff options
author | Vitaly Takmazov | 2018-04-02 13:58:22 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-04-02 13:58:22 +0300 |
commit | c469abc2a0cdef22b789c7b26ac05f261d21c870 (patch) | |
tree | c8691e2f1453778cbdddd7ca35a2b0d705b8ab5a /juick-server/src | |
parent | cb2d7e63fc9af26b06c2f02c98940aafecd87292 (diff) |
xmpp: router send s2s to server
Diffstat (limited to 'juick-server/src')
-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); } |