tigase / tigase-server

(M) Highly optimized, extremely modular and very flexible XMPP/Jabber server
https://tigase.net
GNU Affero General Public License v3.0
327 stars 106 forks source link

Secondary development online and offline messages #211

Open whwususu opened 1 year ago

whwususu commented 1 year ago

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="test01@localhost.com/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 commented 1 year ago
[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="test01@localhost.com/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="test01@localhost.com/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="test01@localhost.com/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="test01@localhost.com/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="test01@localhost.com/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 commented 1 year ago

image

message-router--QueueListener:from=null, to=sess-man@laptop-jjogo4vd, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" to="test01@localhost.com"/>, 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="test01@localhost.com"/>, 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="test01@localhost.com"/>, SIZE=59, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=AUTH, TYPE=null, STABLE_ID=40d6e8d3-c6d7-48ab-8de8-127522b1869c 
whwususu commented 1 year ago
message-router--QueueListener:from=null, to=sess-man@laptop-jjogo4vd, serverAuthorisedStanzaFrom=Optional.empty, DATA=<presence xmlns="jabber:client" to="test01@localhost.com" from="test02@localhost.com"/>, 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="test01@localhost.com" from="test02@localhost.com"/>, SIZE=87, XMLNS=jabber:client, PRIORITY=PRESENCE, PERMISSION=NONE, TYPE=null, STABLE_ID=null
woj-tek commented 1 year ago

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.

whwususu commented 1 year ago

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

woj-tek commented 1 year ago

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?