cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
901
Views
0
Helpful
7
Replies

querying active subscriptions in the notification mechanism

stephan.steiner
Spotlight
Spotlight

Hi

Since subscriptions are persistent, I figured I'd try to query if I'm already subscribed to a node after connecting. While I do get a response, it is always 403, even when I query the user I'm logged in with.

Am I doing something wrong or is querying the subscription list not supported (and if not.. what's the workaround.. after all applications may crash and you have to clear up things without rebooting the entire cluster).

Here's the request and answer that go over the wire

<iq id="MX_15" type="get" to="pubsub.chdevuccx105.nxodev.intra"><pubsub xmlns="http://jabber.org/protocol/pubsub#owner"><subscriptions node="/finesse/api/User/lsste" /></pubsub></iq>


<iq type="error" id="MX_15" from="pubsub.chdevuccx105.nxodev.intra" to="lsste@chdevuccx105.nxodev.intra/MatriX"><pubsub xmlns="http://jabber.org/protocol/pubsub#owner"><subscriptions node="/finesse/api/User/lsste"/></pubsub><error code="403" type="auth"><forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>

1 Accepted Solution

Accepted Solutions

Thanks, that got me on the right track

Here's a working command that I managed to send in Pidgin

<iq to='pubsub.chdevuccx105.nxodev.intra' id='console8d6ddcb4' type='get'>

<pubsub xmlns='http://jabber.org/protocol/pubsub'>

<subscriptions/>

</pubsub>

</iq>

Somehow, the Matrix library keeps generating this

<iq to='pubsub.chdevuccx105.nxodev.intra' id='console8d6ddcb4' type='get'>

<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>

<subscriptions />

</pubsub>

</iq>

And that doesn't work. Now that I know what is working I can ask the makers of Matrix how I can adapt my method calls to get this working.

One thing.. I take it subscriptions are 'per server'.. so if I subscribe on the primary server, and it goes down I have to make the same subscriptions again on the secondary, correct?

View solution in original post

7 Replies 7

ewindgat
Level 5
Level 5

I see there is a 403 access denied. Could I ask what the scenario is? Is this regarding gadget development?

It's a server to server scenario... I'm trying to deal with switchover and disconnect scenarios so before subscribing again I'd like to know what will already delivered to me.

How are you authenticating for the API call? Since its a 403, that could be the first issue to review.

I authenticate normally.. it's XMPP, so I'm connecting with the credentials of an agent. As I'm getting all the messages for user and dialog changes, things seem to be in order. I can also subscribe for notifications for other users and teams and then do get their events.. so all seems to be in order. All that happens in the context of the one XMPP connection so there's no per call authentication like there is with the REST API.

dekwan
Cisco Employee
Cisco Employee

Can you try example 20 here: http://www.xmpp.org/extensions/xep-0060.html#entity-subscriptions

<iq type='get'
   
from='francisco@denmark.lit/barracks'
   
to='pubsub.shakespeare.lit'
   
id='subscriptions1'>
 
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
   
<subscriptions/>
 
</pubsub>
</iq>

Thanks, that got me on the right track

Here's a working command that I managed to send in Pidgin

<iq to='pubsub.chdevuccx105.nxodev.intra' id='console8d6ddcb4' type='get'>

<pubsub xmlns='http://jabber.org/protocol/pubsub'>

<subscriptions/>

</pubsub>

</iq>

Somehow, the Matrix library keeps generating this

<iq to='pubsub.chdevuccx105.nxodev.intra' id='console8d6ddcb4' type='get'>

<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>

<subscriptions />

</pubsub>

</iq>

And that doesn't work. Now that I know what is working I can ask the makers of Matrix how I can adapt my method calls to get this working.

One thing.. I take it subscriptions are 'per server'.. so if I subscribe on the primary server, and it goes down I have to make the same subscriptions again on the secondary, correct?

Correct. Subscriptions are per server so if the primary server goes down, you would need to redo the subscriptions.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: