[jdev] Jabber-RPC versus iq/query?

Jason McIntosh jmac at jmac.org
Thu Mar 4 08:19:55 CST 2004


I have a question of Jabber programming style. The Jabber-based project 
I'm currently working on (http://volity.org) defines a handful of 
different Jabber-RPC requests that its clients and servers (all of whom 
are simply users, from Jabber's POV) can pass around, forming a 
higher-level protocol that rides atop Jabber/XMPP.

However, since learning more about the core Jabber protocol (I admit 
that I started by learning the current MUC and disco JEPs in detail, 
and then worked my way inwards thereafter), I'm starting to wonder if 
some or perhaps all of these RPC requests should instead happen through 
the standard iq/query elements, using namespaces unique to our project. 
Many of these project-specific functions are literally information 
queries, while others request that the receiving entity attempt to 
perform some action on its end. My gut reaction would be to assign the 
latter sorts of activities to RPC, but I do notice that Jabber has 
things like in-band registration happen through iq elements as well.

So I could do continue doing everything specific to our project via 
RPC, and everything would more or less work fine, but I have to wonder 
if it's "more correct" and perhaps even practically better to use query 
elements with proper namespaces when possible (in which case I may end 
up dropping RPC altogether). Is there a general style guideline for 
when an application using Jabber/XMPP as its transport should favor 
Jabber-RPC over <iq><query xmlns="http://my.namespace.com/foo"/></iq> 
elements, or vice-versa?

--
   Jason McIntosh             jmac at jmac.org
Somerville, MA, USA       http://www.jmac.org




More information about the JDev mailing list