[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: code design guideline question
Cyrille Giquello a écrit :
> Marcel Ruff a écrit :
>
> > Cyrille Giquello wrote:
> > > Hi Marcel,
> > > and other if there some ;o)
> > >
> > > I would like a code design guideline.
> > >
> > > How to make change that xmlBlaster.engine.ClientInfo can call a method of
> > > xmlBlaster.engine.RequestBroker ?
> > > I didn't find any clean idea.
> > >
> > > What's for ?
> > > hehe ... ;o)
> > > It's for my very old need : erasing PTP Persistent message.
> > > So I need to tell to the RequestBroker.persistenceDriver that it can erase a message Id.
> > > At next server restart the message will not be loaded again.
> >
> > I just used your TestPersistence2 testcase.
> > It seems that the
> >
> > strArr = senderConnection.erase(xmlKey, qos)
> >
> > porperly erases the persistent message.
> >
> > $HOME/tmp/HelloDurable-XmlKey.xml
> >
> > disappears after erase() as expected.
> >
> > What is different in your case?
To see the problem you can make a little modification in
testsuite.org.xmlBlaster.TestPtDQueue.java
in public void testPtUnknownDestination()
// Construct a message and send it to "Martin Unknown"
String xmlKey = "<key oid='' contentMime='text/plain'>\n" +
"</key>";
String qos = "<qos>" +
+" <isDurable /> " // <-- add just this flag
+" <destination queryType='EXACT'>" +
receiverName +
" <ForceQueuing />" +
" </destination>" +
"</qos>";
Cyrille
>
>
> It's just for PTP messages.
> There is no stuff to call to erase PTP / Persistents messages.
>
> If you send a PTP message with a Durable property,
> you'll get all the time the message at each server restart...
>
> look at that scenario :
>
> 1/ RequestBroker.loadPersistentMessages()
> do a publish() of messages found in persistence folder.
>
> 2/ RequestBroker.publish()
> ...
> if (publishQoS.isPubSubStyle()) {
> ...
> messageContainerMap.put();
> ...
> }else if (publishQoS.isPTP_Style()) {
> ...
> destinationClient.sendUpdate(); // <-- Go there
> ...
> }
> ...
> }
>
> 3/ ClientInfo.sendUpdate()
> ... client not logged ...
> queueMessage(msgUnitWrapper, destination);
>
> 4/ ClientInfo.notifyAboutLogin() {
> ...
> if (messageQueue != null) {
> ...
> while (true) {
> MessageUnitWrapper msgUnitWrapper = messageQueue.pull();
> ...
>
> My need is to find a place to notify the PersistenceDriver that message has to be erased ...
>
> I hope to been clear enough ??
>
> Cyrille
>
> >
> >
> > Marcel
> >
> > >
> > > Thanks for comment & idea.
> > >
> > >
> > > --
> > > Cyrille / Ktaland
> > >
> > > -----------------------------------------
> > > - http://www.ktaland.com/
> > > - Pour votre MAC: http://TOUSOFT.COM/
> > > -----------------------------------------
> > >
> > > Encryption | Duncan Campbell | DST | Blacklisted 411 | ECHELON | 2600 | PGP | Corsica |
> > > NSA
> > >
> > >
> > >
> > >
> >
> > --
> > Marcel Ruff
> > mailto:ruff at swand.lake.de
> > http://www.lake.de/home/lake/swand/
> > http://www.xmlBlaster.org