cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
396
Views
0
Helpful
7
Replies
Highlighted
Rising star

querying active subscriptions in the notification mechanism

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>

Everyone's tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
Rising star

Re: querying active subscriptions in the notification mechanism

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?

7 REPLIES 7
Contributor

Re: querying active subscriptions in the notification mechanism

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

Rising star

Re: querying active subscriptions in the notification mechanism

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.

Contributor

Re: querying active subscriptions in the notification mechanism

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

Rising star

Re: querying active subscriptions in the notification mechanism

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.

Cisco Employee

Re: querying active subscriptions in the notification mechanism

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>

Rising star

Re: querying active subscriptions in the notification mechanism

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?

Cisco Employee

Re: querying active subscriptions in the notification mechanism

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

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards