Why interceptPacket is called for every previous message when openfire restarts

i have a plugin which interceptsPacket and performs further actions. the problem i am facing is whenever i restart openfire all the previous messages are intercepted again

please give me solution if anybody knows so that it does not gets intercepted again

Interceptors are fired for every stanza that arrives at the server, but also for all stanzas that are sent from it. From what you describe, I think that you’re intercepting some kind of archive that is being send (perhaps to a reconnecting client).

@guus
i have a plugin that i created for Dialogflow integration with open fire. this plugin intercepts all the messages through packetinterceptor.

i am not able to ignore the messages when i restart the server. these are the messages which have been sent to the dialogflow bot by the user when these are processed again then the bot starts responding.

i am not sure about the reconnecting client. shall i show you the logs or any other info if you could help from that

The packet interceptor is stateless - it will not ‘fire again’ when it is restarted - it must be triggered by data that is resent. This can happen in many ways - for instance, a client that (re)connect might resend the data again, or might request some sort of archive that include all previously exchanged messages.

You’ll need to debug Openfire to determine where the messages that you see as duplicates are coming from.