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

RE: [xmlblaster] Subscriber getting first message only

It looks like it's my subscriber.  I have two different ones... an EXACT
subscriber, and an XPATH subscriber.

The XPATH subscriber gets all message updates.  The EXACT subscriber
only gets the first update.  The code for each is identical:

            SubscribeKey skey = new SubscribeKey(global, subscribeOID,
            SubscribeQos sqos = new SubscribeQos(global);
            conn.subscribe(skey, sqos, this);

Except one has "EXACT" and one has "XPATH".  Why do the different
subscribers behave differently?

-----Original Message-----
From: Michele Laghi [mailto:laghi at swissinfo.org] 
Sent: Friday, April 04, 2003 4:15 PM
To: xmlblaster at server.xmlblaster.org
Subject: Re: [xmlblaster] Subscriber getting first message only

Hi again David,
Ok, now I see. The problem is that you published messages with the same 
oid and changed the key of the message. The behaviour you got is normal.

The key of a message is supposed to be immutable:

When you first publish a message, a topic is created for it with the 
given oid, the key of that topic is parsed and put into the BigDomTree.
Subsequent publishes on that topic (on that oid) will not parse the key 
anymore (the performance impact would be prohibitive) and the key is 
considered to be constant. Of course it is a little confusing that you 
did not get an exception when publishing with a new key. In fact you 
even will get the new PublishKey on the update method (and this 
extravagant side effect has been positively used by some of the 
xmlBlaster users).

What I still don't understand however is that you should have received 
an update for all three messages (provided you subscribed before the 


David Hooker wrote:
> Here's the publish code:
>             PublishQos pqos = new PublishQos(global);
>             PublishKey key = new PublishKey(global, oid);
>             String data = getFile(args[0]);
>             MsgUnit msg = new MsgUnit(key, data, pqos);
>             String stamp = Long.toString(System.currentTimeMillis());
>             StringBuffer tags = new StringBuffer();
>             tags.append("<DocSender><timestamp>");
>             tags.append(stamp);
>             tags.append("</timestamp>");
>             tags.append("</DocSender>");
>             key.setClientTags(tags.toString());
>             I_XmlBlasterAccess conn = global.getXmlBlasterAccess();
>             ConnectQos cqos = new ConnectQos(global);
>             cqos.setSessionName(new SessionName(global, "DocSender"));
>             ConnectReturnQos cretqos = conn.connect(cqos, null);
>             PublishReturnQos pretqos = conn.publish(msg);
>             conn.disconnect(new DisconnectQos(global));
> Running the publisher program twice gives two MsgUnitWrapper's in the
> TopicHandler section for the OID.  Each has a different timestamp in
> client tags area.  However, only the first timestamp message is in the
> XmlKeyDom section.
> -----Original Message-----
> From: Michele Laghi [mailto:laghi at swissinfo.org] 
> Sent: Friday, April 04, 2003 3:40 PM
> To: xmlblaster at server.xmlblaster.org
> Subject: Re: [xmlblaster] Subscriber getting first message only
> Hallo David,
> in a normal case you should receive all three messages.
> If you subscribe after having published the messages, then you would 
> only get the last published message. On the other hand you say you 
> receive only the first: if you set explicitly forceUpdate to 'false'
> the publishQos and the content of the messages is the same, then you 
> will only get the first one.
> If none of the mentionned is your case you should send us the code.
> Michele
> David Hooker wrote:
>>I know this is probably answered somewhere, but I've looked for a
> couple
>>of hours and can't find where.
>>I have a publisher which publishes a message with a fixed oid.  I have
>>an EXACT subscriber which subscribes to this oid.
>>The first message published is sent to the subscriber.  The second and
>>subsequent messages published are _not_ being sent to the subscriber.
>>The TopicHandler section for the oid has both messages stored in it,
> but
>>only the first one is referenced in the XmlKeyDom section - the second
>>message isn't listed there.  Why is this?  How can I make sure all
>>messages after the first one are published?
>>(Forgive my questions... I'm new to xmlBlaster.)

Michele Laghi
mailto:laghi at swissinfo.org
tel. +46 8 7492952 / mob. +46 70 4103964