//config.setDebuggerEnabled(true);
XMPPConnection consumerCon = new XMPPConnection(config);
consumerCon.connect();
consumerCon.login("consumer", "consumer");
consumerCon.addPacketListener(new XmppLogger("CONSUMER INBOUND"), new PacketFilter() {
public boolean accept(Packet packet) {
return true;
}
});
consumerCon.addPacketWriterListener(new XmppLogger("CONSUMER OUTBOUND"), new PacketFilter() {
public boolean accept(Packet packet) {
return true;
}
});
final ConsumerMessageListener listener = new ConsumerMessageListener();
consumerCon.getChatManager().addChatListener(new ChatManagerListener() {
public void chatCreated(Chat chat, boolean createdLocally) {
chat.addMessageListener(listener);
}
});
XMPPConnection producerCon = new XMPPConnection(config);
producerCon.connect();
producerCon.login("producer", "producer");
producerCon.addPacketListener(new XmppLogger("PRODUCER INBOUND"), new PacketFilter() {
public boolean accept(Packet packet) {
return true;
}
});
producerCon.addPacketWriterListener(new XmppLogger("PRODUCER OUTBOUND"), new PacketFilter() {
public boolean accept(Packet packet) {
return true;
}
});