Project

General

Profile

Invoke a custom plugin processing from StreamManagement

Mauro Carrio
Added about 5 years ago

Hi,

I already hava a custom plugin that processes all incoming Message stanzas and checks if the destination jid is online or not, so if not, it sends a push notification to the client. I'm customizing StreamManagement due to we need that when the resumption timeout expires it sends a push notification to client. Is there any way from StreamManagementIOProcessor.java to send a specific message stanza to my push notification plugin?

I just tried to queue the message in StreamManagementIOProcesor with:

service.addPacketToSend(packet); // Message stanza

in order to be processed by MessageRouter and send it to my plugin but it didnt worked.

Hope i have been clear enough with my question, if not let me know.

Thanks in advance.


Replies (2)

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam about 5 years ago

Hi,

Method addPacketToSend is method responsible for sending packet to user connection, so it is not possible to use it to send packet to your plugin on SessionManager by MessageRouter. To do that what you want, you should send packet using connectionManager local variable by calling it's processOutPacket method - similar thing to what it is done in line 464

Added by Mauro Carrio almost 5 years ago

Hi Andrzej, it worked!

Thanks a lot.

    (1-2/2)