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

RE: [xmlblaster] Publish/Topic clobbering with multiple clients



Hi again,
of course the oid should be 

oid='__cmd:?topicList' and not clientList.

Please make also a cvs update since we had to fix the code.

Michele


>Hi Colin,
>when you publish to a topic which does not exist xmlBlaster automatically
>creates one for you. When a subsequent publish is done on the same topic
>(the same oid), you actually do an update of the previously published message.
>
>If you want to publish on an existing oid and you don't know which topics
>exist you can make a get with the oid='__cmd:/node/heron/?clientList' specified
>in the key. This way you get a list of all topics.
>
>Michele
>
>
>
>>-- Original Message --
>>From: "Madere, Colin" <colin.madere at ieminc.com>
>>To: "'xmlblaster at server.xmlBlaster.org'"
>>	 <xmlblaster at server.xmlblaster.org>
>>Subject: RE: [xmlblaster] Publish/Topic clobbering with multiple clients
>>Date: Fri, 7 Mar 2003 15:01:29 -0600 
>>Reply-To: xmlblaster at server.xmlBlaster.org
>>
>>
>>It seems I had an odd state of some sort that was causing the problem.
> Now
>>that I stopped and restarted everything the problem seems to have gone
>away.
>>Wonder what I got myself into that caused that.
>>
>>So in normal practice you don't worry about whether a topic exists or
not,
>>you simply subscribe to or publish to it?  Is there an official way to
>only
>>subscribe to or publish to a topic that already exists in xmlBlaster?
>>
>>Thanks
>>
>>> -----Original Message-----
>>> From:	Madere, Colin [SMTP:colin.madere at ieminc.com]
>>> Sent:	Friday, March 07, 2003 2:07 PM
>>> To:	xmlblaster at server.xmlblaster.org
>>> Subject:	[xmlblaster] Publish/Topic clobbering with multiple clients
>>> 
>>> I have identical clients connecting to xmlBlaster to exchange messages.
>>> However, with only rudimentary understanding of the protocol and API,
>I'm
>>> trampling a Topic in my init code somehow.  Meaning, when I launch one
>>> client, I subscribe to an oid, then set up what's needed to publish
via
>>> that
>>> same oid and then set the topic properties.  Then when I launch the
second
>>> client (which executes all the same code), it somehow overwrites the
>topic
>>> (or publish chanel, not sure of the terminology used) in some way so
>that
>>> updates only work when sent from the one that was launched second.
>>> 
>>> I'm thinking I should be checking to see if the topic already exists
>>> somehow?  That I should be asking for the subscribe object from the
>>> server?
>>> I dug through the API, but kind of wound up at dead-ends :(
>>> 
>>> Setup code:
>>> 
>>>             con = new XmlBlasterConnection(glob);
>>> 
>>>             qos = new ConnectQos(glob);
>>>             crq = con.connect(qos, this);  // Login to xmlBlaster,
>>> register
>>> for updates
>>> 
>>>             sk = (oid.length() > 0) ? new SubscribeKey(glob, oid) :
new
>>> SubscribeKey(glob, xpath, Constants.XPATH);
>>>             sq = new SubscribeQos(glob);
>>>             sq.setWantInitialUpdate(true);
>>>             sq.setWantLocal(false);
>>>             sq.setWantContent(true);
>>> 
>>>             HistoryQos historyQos = new HistoryQos(glob);
>>>             historyQos.setNumEntries(historyNumUpdates);
>>>             sq.setHistoryQos(historyQos);
>>> 
>>>             SubscribeReturnQos srq = con.subscribe(sk.toXml(),
>>> sq.toXml());
>>> 
>>>             pk = new PublishKey(glob, oid, "text/xml", "1.0");
>>>             pk.setClientTags("<MyCompany><ProductName/></MyCompany>");
>>>             
>>>             pq = new PublishQos(glob);
>>>             pq.setPriority( PriorityEnum.NORM_PRIORITY );
>>>             pq.setPersistent( false );
>>>             pq.setLifeTime( -1L );
>>>             pq.setSubscribeable( true );
>>> 
>>>             topicProperty = new TopicProperty(glob);
>>>             topicProperty.setDestroyDelay(60000L);
>>>             topicProperty.setCreateDomEntry(true);
>>>             topicProperty.setReadonly(false);
>>>             pq.setTopicProperty(topicProperty);
>>
>
>
>
>
>_______________________________________________________________________
>Dreaming of a Swiss Account? Get it here: http://freemail.swissinfo.org
>




_______________________________________________________________________
Dreaming of a Swiss Account? Get it here: http://freemail.swissinfo.org