0

I am connecting to XMPP server using asmack library from android. Everything works fine except a problem in receiving large offline messages.

As soon as I login, I am getting small messages sent by other user while was in offline mode. But if they are sending some big messages if I was in offline mode, then I am not getting those messages when I login.

Please help me to find a solution.

This is what log cat shows:

07-23 13:14:01.070: D/SMACK(16682): RCV (0): <message from='139@192.168.10.241' to='143@192.168.10.241/false' type='error' id='9lxwn-146'><state xmlns='jabber:state:event'><composing>true</composing></state><error code='500' type='wait'><resource-constraint xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Your contact offline message queue is full. The message has been discarded.</text></error></message><message from='139@192.168.10.241' to='143@192.168.10.241/false' type='error' id='9lxwn-145'><state xmlns='jabber:state:event'><composing>true</composing></state><error code='500' type='wait'><resource-constraint xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Your contact offline message queue is full. The message has been discarded.</text></error></message><message from='139@192.168.10.241' to='143@192.168.10.241/false' type='error' id='9lxwn-144'><state xmlns='jabber:state:event'><composing>true</composing></state><error code='500' type='wait'><resource-constraint xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Your contact offline message queue is full. The message has been discarded.</text></error></message>

Main error is this:

Your contact offline message queue is full. The message has been discarded.

roy mathew
  • 7,782
  • 4
  • 29
  • 40

1 Answers1

2

You can extend Per-user offline message storage limit on server

in Offline Message Policy

If you are using openfire on server side then go to server settings > Offline messages

default size is 100 kb

Jaspreet Chhabra
  • 1,431
  • 15
  • 23
  • Is there any way to know the remaining offline limit from client. That means how can I know, this much limit is remaining? Is there any method in asmack for that? – roy mathew Jul 24 '14 at 11:17
  • 1
    no we can't get it in client side. but you can increase it to some value manually on server side. Can you mark this as answer – Jaspreet Chhabra Jul 24 '14 at 11:19
  • Then can you please suggest any best approach for dealing with offline messages? I am using ejabbered at server side. – roy mathew Jul 24 '14 at 11:23
  • sorry never worked on ejabbered. I have only used openfire – Jaspreet Chhabra Jul 24 '14 at 11:24
  • 1
    Any suggestion to deal with large number of offline messages? Suppose I am sending 100 offline messages to another contact and my server limit is 75, then how can I know this limit and handle remaining 25 messages? – roy mathew Jul 24 '14 at 11:37
  • In my case I have used web service to get offline messages. I have updated archive plugin to get offline messages via web service which doesn't have any limitation see this link http://stackoverflow.com/questions/24674665/xmpp-messages-lost-on-android-while-switching-data-connectivity-e-g-turning-wi/24713414#24713414 – Jaspreet Chhabra Jul 24 '14 at 11:47