Project

General

Profile

Question about pubsub#presence_based_delivery config

Kelly Kuang
Added almost 3 years ago

I config a node pubsub#presence_based_delivery=true, then I publish item.

But neither online nor offline subscriber(include the owner) does not receive the message.

I debug and find that there is no item in the presenceByService of tigase.pubsub.modules.PresenceCollectorModule.

*Why is the presenceByService empty?

Do I need to send a "presence" packet to PubSub component by client-side?*

My Tigase server version is 7.0.2 and PubSub component version is 3.1.0.


Replies (5)

(1)

Added by Wojciech Kapcia TigaseTeam almost 3 years ago

Kelly Kuang wrote:

*Why is the presenceByService empty?

Do I need to send a "presence" packet to PubSub component by client-side?*

Yes, pubsub needs to be aware of client presence state in order for this to work correctly.

Added by Kelly Kuang almost 3 years ago

Thank you very much. I have try to send "presence" packet to PubSub component, but there is still problem.

  1. I send presence packet to server.
<presence>
  <c xmlns="http://jabber.org/protocol/caps" node="http://tigase.org/jaxmpp" ver="KhhXORGt+KZlidZ8gbUHFvHRIws=" hash="sha-1"></c>
</presence>

*I comfirm that the packet is effect. Because I can see user online with Psi client(use another account).

But the presenceByService in PresenceCollectorModule is still empty...*

  1. Then I send another presence packet with "to='pubsub.im.tx-tech.com'" attribute.
<presence to="pubsub.im.tx-tech.com"/>

*Then It works. The presenceByService in PresenceCollectorModule has jid. And online user can receive publish message.

I want to confirm that do I need to send two presence pakcet to server? What is the cause of the first package is not effect for PresenceCollectorModule?*

  1. I find the tigase.pubsub.PepPlugin and setup it to server. After send the first presence packet(without to attribute), the presenceByService in PresenceCollectorModule has jid.

But online user still does not recive publish message.

I check the PresenceCollectorModule code and find that there is no "pubsub.im.tx-tech.com" jid.

Added by Wojciech Kapcia TigaseTeam almost 3 years ago

Kelly Kuang wrote:

Thank you very much. I have try to send "presence" packet to PubSub component, but there is still problem.

  1. I send presence packet to server.

[...]

*I comfirm that the packet is effect. Because I can see user online with Psi client(use another account).

But the presenceByService in PresenceCollectorModule is still empty...*

  1. Then I send another presence packet with "to='pubsub.im.tx-tech.com'" attribute.

[...]

*Then It works. The presenceByService in PresenceCollectorModule has jid. And online user can receive publish message.

I want to confirm that do I need to send two presence pakcet to server? What is the cause of the first package is not effect for PresenceCollectorModule?*

This is correct - initial presence is only send/broadcast to your contacts so you need to either:

  • send direct-presence to pubsub component;

  • include pubsub component in your rooster (ask for subscription).

Depending on your use-case one or the other can be more useful.

  1. I find the tigase.pubsub.PepPlugin and setup it to server. After send the first presence packet(without to attribute), the presenceByService in PresenceCollectorModule has jid.

But online user still does not recive publish message.

I check the PresenceCollectorModule code and find that there is no "pubsub.im.tx-tech.com" jid.

PEP plugin is only used and related to Personal Eventing Protocol, which is a subset of PubSub.

Added by Kelly Kuang almost 3 years ago

Thank you. I have tried above two use-case and they works.

But I can not decide which one to use. (Maybe I need to read the protocol about presence.)

Could you please suggest me which one is usually use?

(1)

Added by Wojciech Kapcia TigaseTeam almost 3 years ago

Kelly Kuang wrote:

Thank you. I have tried above two use-case and they works.

But I can not decide which one to use. (Maybe I need to read the protocol about presence.)

Could you please suggest me which one is usually use?

This depends on the preferences / use-case - if this should be applicable to all users of the service and you have full control over either client application or server then it would be better to generate those presence by application.

    (1-5/5)