Tigase actively disconnects from client with smack

w xy
Added 4 months ago


watchdog_delay = 50000
watchdog_ping_type = 'xmpp'
watchdog_timeout = 30000

Dozens of seconds later,tigase close session:

tigase.cluster.SessionManagerClustered close closeConnection:10008@xmpp.server/Smack
tigase.cluster.SessionManagerClustered close closeConnection:10009@xmpp.server/Smack
Stream closed from: c2s@/
Stream closed from: c2s@

And, i send 10,000 messages via smack -> conn.sendStanzaWithResponseCallback, but only 3,000 messages were sent, and the rest were still in the blocking queue named ConcurrentLinkedQueue.

Replies (4)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam 4 months ago

I'm not sure what you were trying to achieve, but sending over 10000 messages one by one over a single connection is never a good idea and suggest that connected client might be a spammer and is using more resources than it should.

Due to that Tigase XMPP Server has a throttling mechanism which is enabled by default and by default it is set to allow 2500 messages per minute over a single XMPP client-to-server connection (or 20MB of data). If the limit is exceeded then the connection is dropped (closed). I suppose that your test client might not detect that connection was closed.

Added by w xy 4 months ago

I want to push bulletins to everyone. What's a good way to send a lot of messages?

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam 4 months ago

I would recommend reducing the number of messages sent in a period of time if possible. This will reduce the load on the server and backend database (messages sent to offline users needs to be stored in the offline storage).

Alternatively, you can:

  • increase throttling limit (it is described in Tigase XMPP Server documentation)
  • use component connection (it has higher limit)

However, I would recommend reducing the number of stanzas per second which you are sending as it will have the best results for your installation.

Added by w xy 4 months ago

I couldn't hear the connection was closed by this:

conn.addConnectionListener(new MyConnectionListener(conn));

public void connectionClosed() { != conn ? conn.getStreamId() : "") + " ====> connectionClosed");
conn = null;

there is a another way to get it?