[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster] implementing query in addition to publish / subscribe



Ok, I tried to use "get" to retrieve all messages for a given topic.

After publishing a bunch of messages, I call get but only receive a
single message. This cannot be the desired semantics for get, is it ?

I double checked that the database tables are large enough to hold
multiple messages for a topic, and that seems to be true.

Here is the code snippet:

try {
    GetKey gk = new GetKey (getCurCon().getGlobal(),
			    xpath,
			    Constants.XPATH);	    
    String qos = "<qos></qos>";
    System.err.println ("stub querying synchronously for "+gk.toXml()+" "+qos);
    return getCurCon().get (gk.toXml(), qos);
    
} catch (Exception e) {
    e.printStackTrace();
}

xpath="/xmlBlaster/key/MyType[Name='WeatherImage']"

and I have published 12 messages that fit this predicate.

Any clues ?

Michael

On Tue, Mar 04, 2003 at 11:51:53PM +0000, laghi at swissinfo.org wrote:
> Hallo Michael,
> if you want to make a request synchroneously then "get" is the correct choice.
> 
> 
> If the kind of query would be of lets say the kind:
> 
> a) "Give me back the last 5 messages of a particular topic" or 
> b) "give me all messages since Christmas for a given topic"
> 
> It is what we call history queue queries, that is, queries regarding a specific
> topic (a specific msg oid). These are on our high priority list and will
> be implemented as a plugin. Fore more exotic queries one can then write
> a more specific plugin.
> 
> For case a) there is already a way of doing it. See the requirement: http://www.xmlBlaster.org/xmlBlaster/doc/requirements/interface.subscribe.html
> for an example or have a look at HelloWorldSubscribe.
> 
> 
> Cheers
> Michele
> 
> 
> >Date: Tue, 4 Mar 2003 18:23:29 -0500
> >From: Michael Atighetchi <matighet at bbn.com>
> >To: xmlblaster at server.xmlblaster.org
> >Subject: Re: [xmlblaster] implementing query in addition to publish / subscribe
> >Reply-To: xmlblaster at server.xmlBlaster.org
> >
> >
> >It seems the get method is doing exactly what I want
> >synchronously. I'll investigate wheather this will do for our use case.
> >
> >Michael
> >
> >On Tue, Mar 04, 2003 at 06:10:45PM -0500, Michael Atighetchi wrote:
> >> How difficult would it be to enhance xmlblaster to deal with query
> >> operations in addition to publish & subscribe ?
> >> 
> >> The query operation would be very similar (ie allow xpath
> >> and regex matching) to a time-limited subscribe operation that only
> >> returns the current set of messages known to xmlblaster and the
> >> terminates.
> >> 
> >> It could probably be implemented using direct JDBC calls, however, I
> >> would prefer an implementation that goes through xmlblaster utilizing
> >> the parsed messages in the DOM.
> >> 
> >> Anyone has ideas about how to best approach this ?
> >> 
> >> Michael
> >> 
> >
> 
> 
> 
> 
> ________________________________________
> Dreaming of a Swiss Account? Get it here: http://freemail.swissinfo.org
> 

-- 
matighet at bbn.com   BBN Technologies