[ejabberd] exmpp_component and PubSub

Pablo Polvorin pablo.polvorin at process-one.net
Tue Dec 1 21:16:26 MSK 2009


Hello Ian,
could you look if there is anything strange in the ejabberd's logs
between the info report at "2009-12-01 16:39:08"   and the error at
"2009-12-01 16:45:34" ?.

Specifically,  it isn't your component disconnected for some reason?.


2009/12/1 Ian Wilkinson <the.ian.wilkinson at googlemail.com>:
> Hi,
> My apologies if this is the wrong list for posting the following.
> I'm currently doing discovery on the exmpp_component, specifically,
> around PubSub support.
> I have used the "Scalable XMPP bots" series
> (http://www.process-one.net/en/blogs/article/scalable_xmpp_bots_with_erlang_and_exmpp_part_i/)
> to provide the early learning.
> From that, I produced an external component (modelled after the
> web_status_component), and
> included the service within the installed ejabberd configuration. I
> instrumented this component to log iq,
> message and presence packets.
> However, when I attempt to retrieve subscriptions from the component (
> http://xmpp.org/extensions/xep-0060.html#entity-subscriptions), I see no
> logging from the
> component, and the ejabberd.log is indicating the service is unavailable.
> I'm including the shell session, ejabberd configuration, and ejabberd.log
> output.
> Have I made some dumb assumptions, or should I be seeing some initial
> logging
> from the external component I launched.
> many thanks,
> ian
>
> 1> hugin_feed_component:start_link().
> ...
> {ok,<0.69.0>}
> 2> Session = exmpp_session:start().
> <0.86.0>
> 3> Jid = exmpp_jid:make("iw", "macintosh-4.local").
> {jid,<<"iw at macintosh-4.local">>,<<"iw">>,
>      <<"macintosh-4.local">>,undefined}
> 4> exmpp_session:auth_basic_digest(Session, Jid, "secret").
> ok
> 5> exmpp_session:connect_TCP(Session, "localhost", 5222).
> "3670992088"
> 6> Iq = exmpp_client_pubsub:get_subscriptions("feeds.macintosh-4.local").
> {xmlel,'jabber:client',[],iq,
>        [{xmlattr,undefined,type,<<"get">>},
>         {xmlattr,undefined,to,<<"feeds.macintosh-4.local">>},
>         {xmlattr,undefined,id,<<"pubsub-396429316">>}],
>        [{xmlel,'http://jabber.org/protocol/pubsub',[],pubsub,[],
>                [{xmlel,'http://jabber.org/protocol/pubsub',[],
>                        subscriptions,[],[]}]}]}
> 7> Iq2 = exmpp_stanza:set_sender(Iq, Jid).
> {xmlel,'jabber:client',[],iq,
>       [{xmlattr,undefined,type,<<"get">>},
>        {xmlattr,undefined,to,<<"feeds.macintosh-4.local">>},
>        {xmlattr,undefined,id,<<"pubsub-396429316">>},
>        {xmlattr,undefined,from,<<"iw at macintosh-4.local">>}],
>       [{xmlel,'http://jabber.org/protocol/pubsub',[],pubsub,[],
>               [{xmlel,'http://jabber.org/protocol/pubsub',[],
>                       subscriptions,[],[]}]}]}
> 8> io:format("~s~n", [exmpp_stanza:to_list(Iq2)]).
> <iq type="get" to="feeds.macintosh-4.local" id="pubsub-396429316"
> from="iw at macintosh-4.local"><pubsub
> xmlns="http://jabber.org/protocol/pubsub"><subscriptions/></pubsub></iq>
> ok
> 9> exmpp_session:send_packet(Session, Iq2).
> <<"pubsub-396429316">>
>
> From the ejabberd.cfg:
>   {8889, ejabberd_service, [
>                            {access, all},
>                            {shaper_rule, fast},
>                            {ip, {127, 0, 0, 1}},
>                            {hosts, ["feeds.macintosh-4.local"],
>                            [{password, "secret"}]
>                            }
>                            ]
>   },
>
> From the ejabberd.log:
> =INFO REPORT==== 2009-12-01 16:39:08 ===
> I(<0.362.0>:ejabberd_service:217) : Route registered for service
> "feeds.macintosh-4.local"
> ...
> =INFO REPORT==== 2009-12-01 16:45:34 ===
> D(<0.381.0>:ejabberd_c2s:1376) : Send XML on stream = "<iq
> from='macintosh-4.local' id='pubsub-396429316' type='error'><error
> code='503' type='cancel'><service-unavailable
> xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>"
>
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd
>
>



-- 
Pablo Polvorin
ProcessOne


More information about the ejabberd mailing list