ejabberd - Comments for "Is it possible to subscribe/publish to pubsub node in other XMPP server ?" https://www.ejabberd.im/node/24989 en I did, thank you !!! I did https://www.ejabberd.im/node/24989#comment-65940 <p>I did, thank you !!! I did not understand well that I have to set the entry of pubsub.xmpp1-server.mydomian.com in DNS or /etc/hosts.</p> <p>I added following entries into /etc/hosts :</p> <div class="codeblock"><code>XXX.XXX.XXX.XXX xmpp1-server.mydomain.com xmpp1-server<br />XXX.XXX.XXX.XXX pubsub.xmpp1-server.mydomain.com pubsub.xmpp1-server</code></div> <p>Thank you again for your kind support.</p> Tue, 14 Jul 2015 14:15:11 +0000 jpro comment 65940 at https://www.ejabberd.im You also need to make sure https://www.ejabberd.im/node/24989#comment-65939 <p>You also need to make sure that all the remote components are in DNS or /etc/hosts file. It means you need to have pubsub.domain.com resolved to the proper IP address as well.</p> Tue, 14 Jul 2015 11:10:36 +0000 mremond comment 65939 at https://www.ejabberd.im Thank you for your reply. I'm https://www.ejabberd.im/node/24989#comment-65938 <p>Thank you for your reply. I'm now trying to communicate in a raw message level by connecting to XMPP server by telnet (telnet xmpp1-server 5222). That's taking me to more understanding to the XMPP communication.<br /> However, I still do not know what stanza should be sent to discover/subscribe/publish nodes in different XMPP server. </p> <p>Usually I use <code>&lt;iq to=&quot;pubsub.domain.com&quot;&gt;</code> stanza to identify pubsub service. "pubsub.domain.com" represents a service (or special JID?), not host name. This makes me confuse - how should I identify pubsub services in another XMPP server ? I tried iq to="pubsub@domain.com", "pubsub.domain.com@domain.com" or everything I came up with. But reply from XMPP server is always "remote-server not found" or "service-unavailable".</p> <p>If my understanding is correctly, what I have to do is (1) first identify XMPP server name, then (2) send iq to pubsub service on the XMPP server. But I don't know how to do this or is really possible.</p> <p>I have read related XEP carefully, and also googled as much as possible, however, there are no information or examples how to access pubsub services in different XMPP server.<br /> Just found a discussion on accessing pubsub on different XMPP server, and it seems to be impossible..<br /> <noindex><a href="https://support.process-one.net/browse/EJAB-674" title="https://support.process-one.net/browse/EJAB-674" rel="nofollow" >https://support.process-one.net/browse/EJAB-674</a></noindex></p> Tue, 14 Jul 2015 10:36:19 +0000 jpro comment 65938 at https://www.ejabberd.im Look at the XMPP protocol https://www.ejabberd.im/node/24989#comment-65937 <p>Look at the XMPP protocol level from your client and check what are the packets exchanged. In case of doubt, tries to format / send the packets manually. I personally did not try pubsub on Smack and maybe something is not compliant with the packet they send. Always try checking by going to the XMPP protocol level.</p> Mon, 13 Jul 2015 10:07:59 +0000 mremond comment 65937 at https://www.ejabberd.im Thank you for your https://www.ejabberd.im/node/24989#comment-65935 <p>Thank you for your comment.</p> <p>When I run this code with user2 in xmpp2-server:</p> <div class="codeblock"><code>PubSubManager manager = new PubSubManager(con,&quot;pubsub.xmpp1-server.mydomain.com&quot;);<br />Node node = manager.getNode(&quot;topic1-node&quot;);</code></div> <p>Then, this sends following XMP message to xmpp1-server.</p> <div class="codeblock"><code>&lt;iq to=&#039;pubsub.xmpp1-server.mydomain.com&#039; id=&#039;CSRu4-12&#039; type=&#039;get&#039;&gt;&lt;query xmlns=&#039;http://jabber.org/protocol/disco#info&#039; node=&#039;topic1-node&#039;&gt;&lt;/query&gt;&lt;/iq&gt;</code></div> <p>Then, I got following log in logs/ejabberd.log</p> <div class="codeblock"><code>@ejabberd_s2s:new_connection:460 New s2s connection started &lt;0.1518.0&gt;<br />@ejabberd_s2s_out:log_s2s_out:1303 Trying to open s2s connection: xmpp2-server.mydomain.com -&gt; pubsub.xmpp1-server.mydomain.com with TLS=false<br />@ejabberd_s2s_out:open_socket:266 s2s connection: xmpp2-server.mydomain.com -&gt; pubsub.xmpp1-server.mydomain.com (remote server not found)</code></div> <p>Then, I changed my code as following (replace pubsub.xmpp1-server.mydomain.com to xmpp1-server.mydomain.com just to understand what's happening)</p> <div class="codeblock"><code>PubSubManager manager = new PubSubManager(con,&quot;xmpp1-server.mydomain.com&quot;);<br />Node node = manager.getNode(&quot;topic1-node&quot;);</code></div> <p>Then, this sends following XMP message to xmpp1-server.</p> <div class="codeblock"><code>&lt;iq to=&#039;xmpp1-server.mydomain.com&#039; id=&#039;CSRu4-12&#039; type=&#039;get&#039;&gt;&lt;query xmlns=&#039;http://jabber.org/protocol/disco#info&#039; node=&#039;topic1-node&#039;&gt;&lt;/query&gt;&lt;/iq&gt;</code></div> <p>Then, I got another log.</p> <div class="codeblock"><code>@ejabberd_s2s:new_connection:460 New s2s connection started &lt;0.1532.0&gt;<br />@ejabberd_s2s_out:log_s2s_out:1303 Trying to open s2s connection: xmpp2-server.mydomain.com -&gt; xmpp1-server.mydomain.com with TLS=false<br />@ejabberd_listener:accept:299 (#Port&lt;0.4010&gt;) Accepted connection 133.27.170.67:37315 -&gt; 133.27.170.237:5269<br />@ejabberd_s2s_in:stream_established:524 Accepted s2s dialback authentication for xmpp1-server.mydomain.com (TLS=false)<br />@ejabberd_s2s_out:wait_for_validation:422 Connection established: xmpp2-server.mydomain.com -&gt; xmpp1-server.mydomain.com with TLS=false</code></div> <p>By seeing this log, I felt that s2s communication seems to be ok.<br /> But still I have "item not found" error so I cannot get node from xmpp1-server.<br /> I tried following node identifiers, but all of them are not succeeded.</p> <div class="codeblock"><code>Node node = manager.getNode(&quot;topic1-node&quot;);<br />Node node = manager.getNode(&quot;pubsub.xmpp1-server.mydomain.com/topic1-node&quot;);<br />Node node = manager.getNode(&quot;xmpp.pubsub:pubsub.xmpp1-server.mydomain.com/topic1-node&quot;);</code></div> <p>Do you think this is still problem of s2s communication ?<br /> Thank you very much for your kind support.</p> Mon, 13 Jul 2015 07:16:50 +0000 jpro comment 65935 at https://www.ejabberd.im I do not think it is related https://www.ejabberd.im/node/24989#comment-65934 <p>I do not think it is related to the client code. Check your ejabberd log and make sure both server can get in touch and communicate with each other.</p> Sun, 12 Jul 2015 20:31:39 +0000 mremond comment 65934 at https://www.ejabberd.im Hi, thank you. But I still https://www.ejabberd.im/node/24989#comment-65932 <p>Hi, thank you. But I still cannot succeeded.<br /> I guess my s2s setting (and /etc/hosts configuration) must be ok.<br /> Maybe problem is my code..<br /> I'm using smack for xmpp library, so I have to ask in their community.<br /> But just showing my code for someone interesting to the wrong code...</p> <div class="codeblock"><code>//configuration to connect XMPP2-server<br />XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()<br /> &nbsp; .setHost(&quot;xmpp2-sever.mydomain.com&quot;)<br /> &nbsp; .setPort(5222)<br /> &nbsp; .setServiceName(&quot;xmpp2-server.mydomain.com&quot;)<br /> &nbsp; .setSecurityMode(SecurityMode.disabled)<br /> &nbsp; .build(); <p>XMPPTCPConnection con = new XMPPTCPConnection(config);<br />con.connect();<br />con.login(&quot;user2&quot;,&quot;password&quot;);</p> <p>//get pubsub manager from XMPP1-server<br />PubSubManager manager = new PubSubManager(con,&quot;pubsub.xmpp1-server.mydomain.com&quot;);</p></code></div> <p>Thanks a lot.</p> Sun, 12 Jul 2015 13:33:00 +0000 jpro comment 65932 at https://www.ejabberd.im If you use default port and https://www.ejabberd.im/node/24989#comment-65931 <p>If you use default port and the name of domain is same as name of the server, SRV records are not necessary. You can in that case rely on <code>/etc/hosts</code> for development / testing.</p> Sat, 11 Jul 2015 09:38:22 +0000 mremond comment 65931 at https://www.ejabberd.im Thank you for your reply ! https://www.ejabberd.im/node/24989#comment-65928 <p>Thank you for your reply ! Because I tested two XMPP servers in same network, I thought it's no necessary to set DNS record to our network. </p> <p>I setup following SRV record to enable s2s communication (by seeing <noindex><a href="http://wiki.xmpp.org/web/SRV_Records" title="http://wiki.xmpp.org/web/SRV_Records" rel="nofollow" >http://wiki.xmpp.org/web/SRV_Records</a></noindex>), however, still cannot communicate..<br /> I checked SRV record seems to be set correctly to our DNS server by using "dig" command.</p> <div class="codeblock"><code>_xmpp-server._tcp.xmpp1-server.mydomain.com. 86400 IN SRV 5 0 5269 xmpp1-server.mydomain.com.<br />_xmpp-server._tcp.xmpp2-server.mydomain.com. 86400 IN SRV 5 0 5269 xmpp2-server.mydomain.com.</code></div> <p>I also tried following record, but still not succeeded..</p> <div class="codeblock"><code>_xmpp-server._tcp.xmpp1-server.mydomain.com. 86400 IN SRV 5 0 5269 pubsub.xmpp1-server.mydomain.com.<br />_xmpp-server._tcp.xmpp2-server.mydomain.com. 86400 IN SRV 5 0 5269 pubsub.xmpp2-server.mydomain.com.</code></div> <p>Am I wrong with this setting ? Or my client code ?<br /> I will continue to find solution, but your any further advices will be very helpful.<br /> Thank you !</p> Fri, 10 Jul 2015 12:22:14 +0000 jpro comment 65928 at https://www.ejabberd.im Yes, it is possible to https://www.ejabberd.im/node/24989#comment-65925 <p>Yes, it is possible to subscribe to other servers, if they are connected through s2s. It seems you have network setup issue and the two servers are not communicating with each other.<br /> You probably have not properly set up DNS that would allow both server to support s2s, or did not enable s2s in your config file.</p> Thu, 09 Jul 2015 07:55:03 +0000 mremond comment 65925 at https://www.ejabberd.im