I’‘m trying to send a large message (about 100K) from Smack 3.0.0b1 over Wildfire 3.2.2 to Smack 3.0.0b1. The message is sent without an exception, but never reaches it’'s destination. Is there a limitation on message size in Smack and/or Wildfire?
Can you paste the XML that you are sending or any error that you see in the server? We have a Smack test case that sends “huge” messages and it works fine. I changed it to send a message whose body contains 100K chars and it was successfully received by the other Smack client. Here is the code of the test case.
public void testHugeMessage() {
getConnection(0).sendPacket(new Presence(Presence.Type.available));
getConnection(1).sendPacket(new Presence(Presence.Type.available));
// User2 becomes available again
PacketCollector collector = getConnection(1).createPacketCollector(
new MessageTypeFilter(Message.Type.chat)); // Create message with a body of 4K characters
Message msg = new Message(getFullJID(1), Message.Type.chat);
StringBuilder sb = new StringBuilder(150000);
for (int i = 0; i <= 100000; i++) {
sb.append("X");
}
msg.setBody(sb.toString()); // Send the first message
getConnection(0).sendPacket(msg);
// Check that the connection that sent the message is still connected
assertTrue("Connection was closed", getConnection(0).isConnected());
// Check that the message was received
Message rcv = (Message) collector.nextResult(1000);
assertNotNull("No Message was received", rcv); // Send the second message
getConnection(0).sendPacket(msg);
// Check that the connection that sent the message is still connected
assertTrue("Connection was closed", getConnection(0).isConnected());
// Check that the second message was received
rcv = (Message) collector.nextResult(1000);
assertNotNull("No Message was received", rcv);
}
If you want you can also send me your code so I can test it locally.
I’'m trying to send a large message (about 200 characters) from Smack 3.0.0b1 over Wildfire 3.2.2 to different IM.
For the message larger than 150 characters the message is sent without an exception, but never reaches it’'s destination for Live Messaenger, MSN messenger and yahoo messenger.
For AOL, ICQ and any content beyond the maximum (average 150 characters) body size is truncated.
My source code is the same that you post above.
Can someone help me ? I’'m trying to solve that for a long time…