AnsweredAssumed Answered

Unable to connect to slack xmpp gateway

Question asked by Adrien SALES on Jul 10, 2017
Latest reply on Jul 11, 2017 by Flow

I have activated the slack xmpp gateway. I could connect to it from pidgin to validate that it's working : it does ;-p

Now, i'm starting the java part, but i get the following message and i just could not receive any message :

 

INFOS: Could not resolve DNS SRV resource records for _xmpp-client._tcp.rastadidi.xmpp.slack.com. Consider adding those.

 

I have tried the very latest smack version as i saw it could do the job on some ticket here but no luck for me, it did not work

 

Here is an extract of my pom :

 

<dependencies>

        <!-- https://mvnrepository.com/artifact/org.igniterealtime.smack/smack-core -->

        <dependency>

            <groupId>org.igniterealtime.smack</groupId>

            <artifactId>smack-core</artifactId>

            <version>4.2.1-beta1</version>

        </dependency>

        <dependency>

            <groupId>org.igniterealtime.smack</groupId>

            <artifactId>smack-java7</artifactId>

            <version>4.2.1-beta1</version>

        </dependency>

        <dependency>

            <groupId>org.igniterealtime.smack</groupId>

            <artifactId>smack-tcp</artifactId>

            <version>4.2.1-beta1</version>

        </dependency>

        <dependency>

            <groupId>org.igniterealtime.smack</groupId>

            <artifactId>smack-im</artifactId>

            <version>4.2.1-beta1</version>

        </dependency>

        <dependency>

            <groupId>org.igniterealtime.smack</groupId>

            <artifactId>smack-extensions</artifactId>

            <version>4.2.1-beta1</version>

        </dependency>

 

 

ANd here is the java code (passwd replaces by stars) :

 

XMPPTCPConnectionConfiguration.Builder configBuilder = XMPPTCPConnectionConfiguration.builder();

            configBuilder.setUsernameAndPassword("adrien", "********");

            //configBuilder.setResource("SomeResource");

            configBuilder.setXmppDomain("rastadidi.xmpp.slack.com");

 

            AbstractXMPPConnection connection = new XMPPTCPConnection(configBuilder.build());

// Connect to the server

            connection.connect();

// Log into the server

            connection.login();

            ChatManager chatManager = ChatManager.getInstanceFor(connection);

           

            EntityBareJid jid = JidCreate.entityBareFrom("adrien@rastadidi.xmpp.slack.com");

            Chat chat = chatManager.chatWith(jid);

            chat.send("Howdy!");

 

            // send a message to room !

            connection.disconnect();

Outcomes