[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xmlblaster-devel] About persistent and history
Hi Peng,
I think this was a missunderstanding. The behaviour you describe at the
end of the plugin is exactly what is expected by the
ConsumableQueuePlugin: only one subscriber will receive the message,
thereafter (once acknowledged) the message entry will be deleted. As the
plugin is written there is no guarantee always the same user will get
the message.
According to my understanding of your initial question you don't need
the ConsumableQueuePlugin. I think in fact it would be sufficient to use
a failsafe callback connection. When the client wants to leave the
server it just closes without logging off (then the session is still
on). Besides that, if you want to avoid logging in again after a stop of
xmlBlaster you could use persistent sessions (this way you will not
loose messages after a server crash or stop).
For an example of the failsafe behaviour and configuration have a look at
http://www.xmlblaster.org/xmlBlaster/doc/requirements/client.failsafe.html
(at the end of the page there is a java example)
regards
Michele
peng at qcet.cn wrote:
>>peng at qcet.cn wrote:
>>
>>>Hello:
>>> I try to create a persistent topic(with long life) so every user
>>>first login and receive the Message once(just once);
>>>and if the user second login again,the xmlblaster does not post the Message to this user again.
>>>How can I write the key and Qos?
>>
>>Please look into:
>>
>> http://www.xmlblaster.org/xmlBlaster/doc/requirements/msgDistributor.plugin.ConsumableQueue.html
>>
>>You should have a persistent session for each user and the
>>user should initially login and subscribe to the topic.
>>Like this the messages are collected for all clients even if
>>they are offline.
>>
>>> And I have Question about history,I create a persistent topic(with long life) ,
>>>I pub a message to this topic,after a while,I pub a other message to this topic again,
>>>then I use get(xa, "<key queryType='XPATH'>//key</key>" , "<qos/>", &xmlBlasterException)
>>>method to get the messages, I get the last message only,why I can not get the message I first post?
>>
>>Please see
>>
>> http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.subscribe.html
>>
>>and search for history.
>>
>>
>>The history depth is 10, you can adjust it on first publish, see
>>
>> http://www.xmlblaster.org/xmlBlaster/doc/requirements/interface.publish.html
>>see
>> "<queue relating='history' type='CACHE' maxEntries='1000' ...
>>
>>regards,
>>Marcel
>>
>>PS: Have a look into xmlBlaster/demo/javaclients/HelloWorldSubscribe.java
>> or xmlBlaster/demo/c++/SubscribeDemo.cpp for usage examples.
>>
>>
>>
>>>Thanks very much!
>>>
>>>Peng
>>>
>>>
>>>
>>>
>>
>>
>>--
>>http://www.xmlBlaster.org
>
>
>
> I read the file and try to do this:
>
> first I create client1 like this:
> connection qos is:
> <qos>
> <securityService type="htpasswd" version="1.0"> <![CDATA[<user>peng1</user><passwd>secret</passwd>]]> </securityService>
> <persistent>true</persistent>
> <session name="peng/1" />
> <queue relating="callback" > <callback type="SOCKET" sessionId="topSecret"> socket://192.168.1.102:1593 </callback> </queue>
> </qos>
>
> sub qos is:
> <key oid="Hello" /> <qos><subscribe id="_subId:peng1" /> </qos>
>
> then I create client2,client3,client4,client5 use this
> ( user name =peng2,peng3,peng4,peng5;
> session name=peng/2,peng/3,peng/4,peng/5;
> subscribe id=_subId:peng2,_subId:peng3, ...
> and the socket port is program auto create.
> )
>
> In client5,I pub a message like this:
> <key oid='Hello' />
> <content>info1</content>
> <qos> <topic><msgDistributor typeVersion="ConsumableQueue,1.0"/> </topic> </qos>
>
> only client1 recive the message;
> then I close client1 and pub a message again in client5:
>
> <key oid='Hello' />
> <content>an other message</content>
> <qos> <topic><msgDistributor typeVersion="ConsumableQueue,1.0"/> </topic> </qos>
>
> and at this time only client2 receive the message;
>
> If my xml is wrong?
>
> I also use get() to get the __sys__UserList
> <key oid='__sys__UserList'>
> <__sys__internal/>
> </key>
> <content size='88'><![CDATA[__sys__GuiQuery,__sys__jdbc,__RequestBroker_internal[xmlBlaster_192_168_1_190_3412],peng]]></content>
> <qos>
> <sender>/node/xmlBlaster_192_168_1_190_3412/client/__RequestBroker_internal[xmlBlaster_192_168_1_190_3412]</sender>
> <expiration lifeTime='-1'/>
> <rcvTimestamp nanos='1117442730312000001'/>
> <forceUpdate/>
> <isPublish/>
> </qos>
>
> the user peng1,peng2... not in the List,why?
>
>
>
>
>
>
>