Question

I am implementing QOS in tigase to ensure delivery of messages.Below are listed my QOS steps

  • Caching every message packet ( except composing, typing, stopped etc) in a sorted order of timestamp
  • On receiving delivery notification of packet i delete it from cache
  • After regular intervals a thread is launched to check packets which are still present in cache with time window
  • If thread found any packet in that time window ( it means that message is not delivered) so thread need to send it again

My question is how can i send packet again sitting inside that thread.

  • Can i try addOutPacket from thread ( it's not working right now )
  • Should i implement my QOS in component so that it can easily do addOutPacket
  • Or is there any better way to achieve this

Your suggestions are highly thankful

EDIT:

Some clarifications:

  • We will not save messages in cache indefinitely
  • We will retry every message at most 3 times after which we will save the un-acknowledged packet in the Offline Storage
  • If XEP-0198 is enabled in Tigase by default which I assume it is, we still experience message loss when the connection between server and client is lost (irrecoverable failure). If the network layer takes time to detect an irrecoverable failure, the messages sent to that connection are permanently lost. In case of EDGE or a shaky internet connection, we face this consistently seriously hurting user experience.
Was it helpful?

Solution

Tigase already support XEP-0198 - stream management extension which includes packet delivery confirmation. Therefore I am not sure if you really need to implement your QoS system for Tigase. Please explain why XEP-0198 is not good enough and what you are trying to implement. What you really mean by QoS system? A few other questions - what happens when the message cannot be delivered let's say 100 times? Are you going to retry indefinitely? Another question. How many messages can you keep in your cache? What if your cache is full and you cannot put a new message in the cache? Is your QoS system designed to handle load of 100k messages per second for 10 millions of connected users?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top