tigase-server icon indicating copy to clipboard operation
tigase-server copied to clipboard

Secondary development online and offline messages

Open whwususu opened this issue 2 years ago • 6 comments

I created a 'packet' to send online and offline messages, and then pushed it to the 'sess man' component

from=null, to=sess-man@laptop-jjogo4vd, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" from="[email protected]/2137503554-tigase-1"/>, SIZE=81, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=null, STABLE_ID=null 

Can't 'from' be empty? I only ran to 'sess man' and didn't continue running anymore, and there was no error reported. Online and offline messages cannot be sent to individuals. Thank you!

whwususu avatar Jul 10 '23 09:07 whwususu

[2023-07-10 17:25:27:587] [FINEST  ] [      pool-23-thread-8 ] ClientConnectionManager.processSocketData(): Processing socket data: from=null, to=null, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" busi="online"/>, SIZE=47, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=null, STABLE_ID=null from connection: ws2s@laptop-jjogo4vd/0:0:0:0:0:0:0:1_5290_0:0:0:0:0:0:0:1_58235
[2023-07-10 17:25:27:829] [FINEST  ] [         in_1-sess-man ] SessionManager.processPacket()   : Received packet: from=null, to=sess-man@laptop-jjogo4vd, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" from="[email protected]/2137503554-tigase-1"/>, SIZE=81, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=null, STABLE_ID=null
[2023-07-10 17:25:27:829] [INFO    ] [         in_1-sess-man ] SessionManager.getXMPPResourceConnection(): Message without TO attribute set, don't know what to do wih this: from=null, to=sess-man@laptop-jjogo4vd, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" from="[email protected]/2137503554-tigase-1"/>, SIZE=81, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=null, STABLE_ID=86e18cb5-ac51-416c-bc86-4994e463a013
[2023-07-10 17:25:27:829] [FINEST  ] [         in_1-sess-man ] SessionManager.processPacket()   : processing packet: from=null, to=sess-man@laptop-jjogo4vd, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" from="[email protected]/2137503554-tigase-1"/>, SIZE=81, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=null, STABLE_ID=86e18cb5-ac51-416c-bc86-4994e463a013, connection: null
[2023-07-10 17:25:27:829] [FINEST  ] [         in_1-sess-man ] SessionManager.walk()            : XMPPProcessorIfc: MessageAmp (amp)Request: from=null, to=sess-man@laptop-jjogo4vd, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" from="[email protected]/2137503554-tigase-1"/>, SIZE=81, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=null, STABLE_ID=86e18cb5-ac51-416c-bc86-4994e463a013, conn: null
[2023-07-10 17:25:27:832] [FINEST  ] [         in_1-sess-man ] SessionManager.walk()            : XMPPProcessorIfc: PresenceState (presence-state)Request: from=null, to=sess-man@laptop-jjogo4vd, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" from="[email protected]/2137503554-tigase-1"/>, SIZE=81, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=null, STABLE_ID=86e18cb5-ac51-416c-bc86-4994e463a013, conn: null
[2023-07-10 17:25:27:835] [FINEST  ] [         in_1-sess-man ] SessionManager.processPacket()   : Packet processed by: [amp, presence-state]
[2023-07-10 17:25:30:416] [FINE    ] [           stats-cache ] ComponentInfo.lambda$getImplementationVersion$0(): Problem obtaining version for class: tigase.dist.XmppServerDist, exception: tigase.dist.XmppServerDist
[2023-07-10 17:25:30:416] [WARNING ] [           stats-cache ] ComponentInfo.lambda$getImplementationVersion$1(): Problem obtaining current version information

whwususu avatar Jul 10 '23 09:07 whwususu

image

message-router--QueueListener:from=null, to=sess-man@laptop-jjogo4vd, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" to="[email protected]"/>, SIZE=59, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=null, STABLE_ID=null
[2023-07-10 19:14:45:284] [WARNING ] [           stats-cache ] ComponentInfo.lambda$getImplementationVersion$1(): Problem obtaining current version information
sess-man--QueueListener:from=null, to=sess-man@laptop-jjogo4vd, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" to="[email protected]"/>, SIZE=59, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=null, STABLE_ID=null
[2023-07-10 19:14:46:783] [WARNING ] [           stats-cache ] ComponentInfo.lambda$getImplementationVersion$1(): Problem obtaining current version information
[2023-07-10 19:14:50:783] [WARNING ] [ presence-state-proc-1 ] PresenceState.processInInitial() : Initial presence without from attribute set: from=null, to=sess-man@laptop-jjogo4vd, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" to="[email protected]"/>, SIZE=59, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=AUTH, TYPE=null, STABLE_ID=40d6e8d3-c6d7-48ab-8de8-127522b1869c 

whwususu avatar Jul 10 '23 11:07 whwususu

message-router--QueueListener:from=null, to=sess-man@laptop-jjogo4vd, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" to="[email protected]" from="[email protected]"/>, SIZE=87, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=null, STABLE_ID=null
sess-man--QueueListener:from=null, to=sess-man@laptop-jjogo4vd, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" to="[email protected]" from="[email protected]"/>, SIZE=87, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=null, STABLE_ID=null

whwususu avatar Jul 10 '23 11:07 whwususu

Can't 'from' be empty? I only ran to 'sess man' and didn't continue running anymore, and there was no error reported. Online and offline messages cannot be sent to individuals. Thank you!

Can you restate your problem more clearly?

Firstly: you are sending a presence packet (which is used to signal if you are offline or online) and not a message. Secondly: for message packet you have to provide to address, so the server knows where to send the message. from can be optional in this case, though it's better to specify it as well.

woj-tek avatar Jul 10 '23 17:07 woj-tek

Can't 'from' be empty? I only ran to 'sess man' and didn't continue running anymore, and there was no error reported. Online and offline messages cannot be sent to individuals. Thank you!

Can you restate your problem more clearly?

Firstly: you are sending a presence packet (which is used to signal if you are offline or online) and not a message. Secondly: for message packet you have to provide to address, so the server knows where to send the message. from can be optional in this case, though it's better to specify it as well.

thank you! In 'AbstractMessageReceiver->addPacket',I intercepted the packet and serialized it into a string. After processing through the grpc program, return to the program, convert the string into a packet, call the addOutPacket method of SessionManager, and throw this packet into .

Test01 logs in on the first server, test02 logs in on the second server, and the login message of test02 is forwarded to the first server, which then notifies all users who log in on the first server

whwususu avatar Jul 11 '23 00:07 whwususu

In 'AbstractMessageReceiver->addPacket',I intercepted the packet and serialized it into a string. After processing through the grpc program, return to the program, convert the string into a packet, call the addOutPacket method of SessionManager, and throw this packet into .

How do you convert that string into the packet?

Test01 logs in on the first server, test02 logs in on the second server, and the login message of test02 is forwarded to the first server, which then notifies all users who log in on the first server

What are you trying to achieve here? It looks like some sort of clustering? Which Tigase supports natively?

woj-tek avatar Jul 12 '23 22:07 woj-tek