Re: Re: subscribe gloox-dev
From: Brijesh singh <singh.brijesh@xxxxxxxxx>
Date: Fri, 5 Feb 2010 17:01:46 +0100 (CET)
Dear Petr,

Thanks a lot for kind response.   I implemented SubscriptionHandler/Presence
and I started getting  iq message for add request. Now xmpp client is able
to add the component and able to send/recv messages.

I agree with you that writing component is difficult than client. I have
already written client side and it's working fine. But later I found that
client bot will not scale once many users(10k +) will add this bot. In that
case server handling of roster will cost performance hence I thought will
move to component.

Once again thanks for excellent response...
Best regards
Brijesh




2010/2/3 Petr Menšík <pihhan@xxxxxxxxx>

> AFAIK for components, you have to manage roster yourself, server will
> not help you with that, and roster interface also. I think you have to
> implement SubscriptionHandler, PresenceHandler and more. Making
> component is more difficult than simple client, you have to do more
> yourself. However you can implement more special things, like virtual
> users for component, or transport, if you want. Transports would have
> got roster saved in some database usually, so you would not use internal
> server storage anyway.
> I used only older version 0.9.something to implement components, maybe
> it changed now. You have to for example specify also from attribute for
> stanzas you send, because server will not add them like in client mode.
> You can choose any node and resource o you want to send them from, only
> domain name must match what server uses.
>
> In general, consider, what are advantages of components, and if you will
> use them for something useful. If not, I suggest you write simple
> client.
>
> Brijesh singh píše v Út 02. 02. 2010 v 17:49 +0530:
> > Dear All,
> >
> >
> > I'm trying to learn creating xmpp component bots. I found gloox 1.0 is
> > excellent library to do my job. I'm using ejabberd 2.1.2 which is very
> > easy to setup... Thanks a ton to all the guys... specially  Jakob
> > and Badlop and their teams...
> >
> >
> >
> >
> > My component name is mycomp.sandbox.com and it's connected to ejabberd
> > properly.I have following requirement from this bot :-
> >
> >
> > 1st Question : How user can add gloox component bot in his/her
> > roster ?
> > Pidgin crashes when I try to add it by mycomp.sandbox.com?
> > when I try other way i.e. add one test user test1@xxxxxxxxxxxxxxxxxx,
> > I get following presence packet to my component :
> > <presence from='brij@xxxxxxxxxxxxxxxxxx
> > ' to='test1@xxxxxxxxxxxxxxxxxx
> >  type='subscribe'/>  but my brij roster shows
> > test1@xxxxxxxxxxxxxxxxxx as pending?
> >    Do I need to handle it in my component? If yes, kindly give the
> > example...
> >
> >
> > 2nd Question : How to subscribe all the users presence and iq messages
> > to this component?
> > ejabberd configuration :
> >     {5000, ejabberd_service, [
> >                             {access, all},
> >                             {shaper_rule, fast},
> >                             {ip, {127, 0, 0, 1}},
> >                             {hosts, ["mycomp.sandbox.com"],
> >                              [{password, "secret"}]
> >                             }
> >                            ]}
> > ,
> >
> >
> > Gloox component snippet :-
> > =====================
> > ******************
> >                        j = new Component( XMLNS_COMPONENT_ACCEPT, "
> > sandbox.com"
> > ,
> >                                         "
> > mycomp.sandbox.com"
> > , "secret", 5000 );
> >                         j->disco()->setVersion( "componentTest",
> > GLOOX_VERSION );
> >                         j->disco()->registerDiscoHandler( this );
> >                         j->registerConnectionListener( this );
> >                         j->registerPresenceHandler( this );
> >                         j->registerMessageHandler( this );
> > ******************
> >
> >
> > I have registered for
> > registerPresenceHandler but I'm still not getting any presence change
> > for any user?  Also please let me know how to subscribe for all the iq
> > and message packets ?
> >
> >
> > Kindly help...
> >
> >
> > Thanks in advance...
> > Brijesh
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Prostý textový dokument příloha (footer.txt)
> > --
> > gloox-dev mailing list
> > to unsubscribe:
> > send a message with subject 'unsubscribe gloox-dev' to
> minimalist@xxxxxxxxxx
>
>
> --
> gloox-dev mailing list
> to unsubscribe:
> send a message with subject 'unsubscribe gloox-dev' to
> minimalist@xxxxxxxxxx
>