[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [xmlblaster] Publish/Topic clobbering with multiple clients
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);