Persist connection in java ? (smack / Asmack) thread / executor / service

**How I can keep the session alive? **

**The session closes about 5 minutes. (I check) **

**What is the best way to do this? **

- Options
  • 1 - Thread (I preffer) *

  • 2 - Executor *

  • 3 - Service *

  • 4 - Someone else who does not know? (any listener, send packets random (for alive connect))*

You can put example in java ?

***https://community.igniterealtime.org/thread/52134