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

Re: [xmlblaster] Not getting callback on erase



Can RequestBroker.update be used to publish messages from a native plugin? David Robison

From: Marcel Ruff [mailto:mr at marcelruff.info]
To: xmlblaster at server.xmlBlaster.org
Sent: Sun, 04 Mar 2007 12:43:27 -0500
Subject: Re: [xmlblaster] Not getting callback on erase

Hi Jonathan,

the proper way (also for native plugins) to erase messages is for example:

System.err.println("HelloWorldNative: Connecting with protocol
'LOCAL' to xmlBlaster\n");
I_XmlBlasterAccess con = new XmlBlasterAccess(glob);

ConnectQos qos = new ConnectQos(this.glob); /* Client side
object */
qos.setPtpAllowed(false);
qos.setUserId("A-NATIVE-CLIENT-PLUGIN");
qos.getSessionQos().setSessionTimeout(0L);
con.connect(qos, null); // Login to xmlBlaster as
"A-NATIVE-CLIENT-PLUGIN"

EraseQos eq = new EraseQos(glob);
eq.setForceDestroy(true);
EraseKey theEK = new EraseKey(glob, "Hello");
con.erase(theEK, eq);

As an example see demo/javaclients/HelloWorldNative.java or
HelloWorldNative2.java
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.local.html

The method requestBroker.update() is for internal usage only (cluster
messages
with special syntax) .

regards
Marcel


Jonathan Clark wrote:
> As a followup to my previous email, it appears that the erased topics
> are still in the database in
> the case where they are erased from the plugin, but they do appear to
> be cleaned up from the
> database in the external service case.
>
> Are there know side affects of using a client side connection from
> within a plugin? This seems
> to be the only option to erase topics successfully from within the plugin.
>
> Thanks
> ______________________________________________________________________________
> I have some code that runs as a separate service that generates topics
> and when the message is
> cleared, it then erases the topic after a predefined delay using the
> code below.
>
> EraseQos eq = new EraseQos(glob);
> eq.setForceDestroy(true);
> EraseKey theEK = new EraseKey(glob, oid);
> EraseReturnQos[] eraseArr = con.erase(theEK, eq);
>
> When the erase happens, clients listening on the topic receive a
> callback with the qos.isErased()
> set to true and can react to the erase. However, I want to convert
> the code to run as a plugin so
> that it will only be active when xmlBlaster is running. The code
> runs, but I have run into a problem.
> When I process the erase from within a plugin using the following
> code, then
> clients listening on the topic do not receive a callback indicating
> the erase.
>
> updateKey = new UpdateKey(engineGlob, msgUnit.getKey());
> msgQosData = new MsgQosData(engineGlob, MethodName.ERASE);
> msgQosData.setForceDestroy(true);
> requestBroker.update(sessionInfo, updateKey, null,
> msgQosData);
>
> Any thoughts on why the external erases seem to get propogated and the
> internal erases do not?
> In all cases the topic appears to get erased, however, the clients do
> not know about the erase in
> the second case. Test have been run under 1.5.1.
>
> Jonathan Clark
> Open Roads Consulting, Inc.
> 757-546-3401
>