I have simple test case that connects to the server and tries read a large number of messages. The treshhold seems to be somewhere between 12K - 15K messages. If there is 12K or fewere messages in the jiveOffline table, the program works fine, but if I cross the threshold, I get the following stack trace:
No response from server.:
at org.jivesoftware.smackx.OfflineMessageManager.getMessages(OfflineMessageManager .java:208)
at OfflineTest.main(OfflineTest.java:30)
Here is the simple code I run to test OfflineMessageManager:
import java.util.Iterator;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smackx.OfflineMessageManager;
public class OfflineTest {
public static void main(String[] args) {
try {
ConnectionConfiguration cc = new ConnectionConfiguration(“localhost”,
5222);
cc.setSASLAuthenticationEnabled(false);
XMPPConnection con = new XMPPConnection(cc);
con.connect();
con.login(“user”, “user”, “res”, false);
OfflineMessageManager omm = new OfflineMessageManager(con);
System.out.println(“There are " + omm.getMessageCount() + " offline messages”);
Iterator<Message> itr = omm.getMessages();
int i = 1;
while (itr.hasNext()) {
Message m = itr.next();
System.out.println(i+++ ": " + m.getBody());
}
} catch (XMPPException e) {
e.printStackTrace();
}
}
}