aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-02 13:58:22 +0300
committerGravatar Vitaly Takmazov2018-04-02 13:58:22 +0300
commitc469abc2a0cdef22b789c7b26ac05f261d21c870 (patch)
treec8691e2f1453778cbdddd7ca35a2b0d705b8ab5a
parentcb2d7e63fc9af26b06c2f02c98940aafecd87292 (diff)
xmpp: router send s2s to server
-rw-r--r--juick-server/src/main/java/com/juick/server/xmpp/router/XMPPRouter.java9
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);
}