Discussion:
[Exodus-dev] Pubsub in Exodus
Siracusa, David
2004-07-09 15:29:54 UTC
Permalink
I have a Exodus plugin which subscribes to a word list using pubsub.
The exodus plugin does receive pubsub#events however I don't see the
acknowledgement (response) from my pubsub.pl.

I registered /packet within the plugin with: _packet :=
_exodus.RegisterCallback('/packet', Self);

I also don't get any messages in Process when I try to get the list with
pubsub get items.
I echoed the response to the console in pubsub.pl, appears to be okay.

What do I need to do to see the server response?

Thanks,
Dave Siracusa

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
procedure TWordsPlugin.subscribe();
var
iq, ps, s: TXMLTag;
begin
iq := TXMLTag.Create('iq');

iq.setAttribute('to', 'pubsub.' + _exodus.Server );
iq.setAttribute('from', _exodus.Username + '@' + _exodus.Server );
iq.setAttribute('type', 'set');

ps := iq.AddTag('pubsub');
ps.setAttribute('xmlns', 'http://jabber.org/protocol/pubsub');

s := ps.AddTag('subscribe');
s.setAttribute('node', 'generic/words');
s.setAttribute('jid', _exodus.Username + '@' + _exodus.Server);

_exodus.Send(iq.xml);
iq.Free();
end;
end;

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jabberstudio.org/pipermail/exodus-dev/attachments/20040706/0cd13311/attachment.html
Peter Millard
2004-07-09 15:29:54 UTC
Permalink
Post by Siracusa, David
I have a Exodus plugin which subscribes to a word list using pubsub.
The exodus plugin does receive pubsub#events however I don't see the
acknowledgement (response) from my pubsub.pl.
I registered /packet within the plugin with: _packet :=
_exodus.RegisterCallback('/packet', Self);
This seems odd... if you've registered for /packet, you should receive ALL
packets into the client (not the most efficient way of trapping packets BTW).

Do you see the response coming back into the Exodus debug window? If it doesn't
show up there, it means the server is not sending the packet properly. If it
DOES show up.. it could mean that some other handler is grabbing the packets
before they get to your plugin (which seems unlikely).

It would help a lot to see the actual XML you are sending and receiving.

pgm.
Siracusa, David
2004-07-09 15:29:54 UTC
Permalink
You were absolutely correct, the server (pubsub.pl) had problems
sending. That's why exodus didn't see it. I turned up the debug level
on the server and traced down my request problems within the client.

It works perfectly now.

The pubsub#event and list data come in on different xpaths:
SPUBSUBEVENT =
'/packet/message/x[@xmlns="http://jabber.org/protocol/pubsub#event"]';
SPUBSUBDATA =
'/packet/iq/pubsub[@xmlns="http://jabber.org/protocol/pubsub"]';

Does this seem okay?
-----------------------

I put the word list in a static TStringList.
The plugin class derived(TAutoObject, IExodusPlugin) populates the list.
The plugin class derived(TAutoObject, IExodusChatPlugin) consumes the
list.

Is there someway to get these classes to share the data without making
it global?
It wasn't obvious.
-----------------------

I call (once) subscribe, and get-list in:
..Plugin.NewRoom
..Plugin.NewIM
..Plugin.NewChat
..Plugin.NewOutgoingIM
I'm not sure where and when (within the plugin) to call subscribe,
getlist, and unsubscribe. For example if I disconnect, there appears to
be no calls made into the plugin.

Perhaps you provide guidance, suggestions?
-----------------------

Thanks for the help,
Dave Siracusa

------------------------------

Message: 2
Date: Tue, 6 Jul 2004 15:09:57 -0600
From: "Peter Millard" <***@pgmillard.com>
Subject: Re: [Exodus-dev] Pubsub in Exodus
To: exodus-***@jabberstudio.org
Message-ID: <00a201c4639d$9819cee0$***@pmillard2k>
Content-Type: text/plain; charset="iso-8859-1"; charset="ISO-8859-1"
Post by Siracusa, David
I have a Exodus plugin which subscribes to a word list using pubsub.
The exodus plugin does receive pubsub#events however I don't see the
acknowledgement (response) from my pubsub.pl.
I registered /packet within the plugin with: _packet :=
_exodus.RegisterCallback('/packet', Self);
This seems odd... if you've registered for /packet, you should receive
ALL
packets into the client (not the most efficient way of trapping packets
BTW).

Do you see the response coming back into the Exodus debug window? If it
doesn't
show up there, it means the server is not sending the packet properly.
If it
DOES show up.. it could mean that some other handler is grabbing the
packets
before they get to your plugin (which seems unlikely).

It would help a lot to see the actual XML you are sending and receiving.

pgm.



IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jabberstudio.org/pipermail/exodus-dev/attachments/20040707/91b15210/attachment.html
Loading...