Hi Team
i am trying to make a connection and sending a message with openfire using smack java api.
i am not getting any error on my java code but not sure about message is delivered to openfire or not. To check this i used a convers.js client, connected it to openfire using configuration. It means whatever message i am sending from java code, should appear at converse chat window.
but message is not received to converse chat window.please find below java and converse.js configuration.
java code :-
Blockquote
DomainBareJid serviceName = JidCreate.domainBareFrom(“anonymous@conference.l-1054.con.com”);
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
.setUsernameAndPassword(“admin”, “—”)
.setXmppDomain(serviceName)
.setHost(“localhost”)
.setPort(5222)
.setSecurityMode(SecurityMode.disabled) // Do not disable TLS except for test purposes!
.build();
AbstractXMPPConnection connection = new XMPPTCPConnection(config);
connection.connect().login();
ChatManager chatManager = ChatManager.getInstanceFor(connection);
chatManager.addIncomingListener(new IncomingChatMessageListener() {
@Override
public
void newIncomingMessage(EntityBareJid from, Message message, Chat chat) {
System.out.println("New message from " + from + ": " + message.getBody());
}
});
EntityBareJid jid = JidCreate.entityBareFrom("anonymous@conference.l-1054.con.com");
Chat chat = chatManager.chatWith(jid);
chat.send("Howdy!");
Converse.js config :-
Blockquote
converse.initialize({
allow_logout: false,
allow_muc_invitations: false,
allow_contact_requests: false,
authentication: ‘anonymous’,
auto_login: true,
auto_join_rooms: [
‘anonymous@conference.l-1054.con.com’,
],
notify_all_room_messages: [
‘anonymous@conference.l-1054.con.com’,
],
bosh_service_url: ‘http://l-1054.con.com:7070/http-bind/’,
jid: ‘con.com’,
keepalive: true,
hide_muc_server: true,
play_sounds: true,
show_controlbox_by_default: true,
strict_plugin_dependencies: false,
});
Please check if i am doing anything wrong. where can i check the message in openfire (any logs or database).
in above code i am also confused whether i am inputting right jid (domainBareFrom / entityBareFrom).
Thanks in Advance.