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

Re: [xmlblaster] Retrieve an external custom property in the '__sys__Event' message



Salut Richard,

1) Add this to xmlBlasterPlugins.xml

<plugin create='true' id='subscriptionSpecificEvents' className='org.xmlBlaster.engine.EventPlugin'>
<action do='LOAD' onStartupRunlevel='8' sequence='4'/>
<action do='STOP' onShutdownRunlevel='7' sequence='4'/>
<attribute id='eventTypes'>topic/*/event/subscribe,topic/*/event/unSubscribe</attribute>
<attribute id='destination.publish'>
"publish.key=<key oid='__sys__Subscribe'><__sys__internal/></key>",
"publish.qos=<qos><expiration lifeTime='0'/><topic destroyDelay='30000'><persistence relating='msgUnitStore' type='RAM'/><queue relating='history' type='RAM'/></topic></qos>"
</attribute>
</plugin>


2) Start the server

java -Dcom.sun.management.jmxremote org.xmlBlaster.Main -cluster.node.id heron

3) Start a listener to '__sys__Subscribe' events (just to see that it works)

java javaclients.simplereader.SimpleReaderGui

 and hit "Subscribe"

4) Do a subscribe (and unSubscribe by hitting 'u') with an added SubscribeQos property "myProperty"

java -Dcom.sun.management.jmxremote javaclients.HelloWorldSubscribe -clientProperty[myProperty] 1234

5) Enjoy

Now the SimpleReaderGui event notification contains a
<clientProperty name='myProperty'>1234</clientProperty>
markup in the UpdateQos.


IMPORTANT NOTE: Please update again from current svn as i have added an important recursion detection
for your case!


regards
Marcel





richard.aillet at fr.thalesgroup.com wrote:
Hi Marcel,

Thanks for your response (I just read your response, I don't know why I
did'nt receive directly an E-mail as I subscribed to the mailing list
"xmlblaster at server.xmlBlaster.org" ??)

What do you mean by "this information is not delivered" ? There is no
documentation ?

If you have coded and commit the functionality I need, could you please give
some hooks (classes, package, method concerned in the API, ..) where I can
search in the xmlBlaster sources to test it.

Richard.



Re: [xmlblaster] Retrieve an external custom property in the '__sys__Event'
messag e


Marcel Ruff Tue, 29 Jan 2008 11:12:48 -0800

Hi Richard,

this information is not delivered.

However, I have coded it quickly and commited it (completely untested, no
testsuite yet, but it is no dangerous spot as not in the core and should work).
Please check xmlBlaster out from svn and try it and give feedback,


Marcel

[EMAIL PROTECTED] wrote:

Hi,

I want to capture the two following evenTypes :
topic/*/event/subscribe and
topic/*/event/unSubscribe Following the advice of the REQ admin.event, my client (subscribing
to
__sys__Event) receives effectively an event like the following when
another
client invokes the subscribe() method :

<key oid='__sys__Event' contentMimeExtended='1.0'>
<org.xmlBlaster><event/></org.xmlBlaster>
</key>
<content size='23'>topic/*/event/subscribe</content>
<qos>
<clientProperty

name='_subscriptionId'>__subId:heron-1136812798913000000</clientProperty>
<clientProperty name='_nodeId'>heron</clientProperty>
<clientProperty name='_description'
encoding='base64'>...</clientProperty>
<clientProperty
name='_eventType'>topic/*/event/subscribe</clientProperty>
<clientProperty name='_summary'>New subscription of client
/node/heron/client/joe/1 on topic airport</clientProperty>
<clientProperty name='_publicSessionId'
type='long'>1</clientProperty>
<clientProperty name='_subjectId'>joe</clientProperty>
<clientProperty
name='_absoluteName'>/node/heron/client/joe/1</clientProperty>
<clientProperty name='_topicId'>airport</clientProperty>
</qos>

My problem: I would like to retrieve a custom property set by the
subscriber (who invokes the subscribe() method) in the qos part of the previous
message.

For example, a subscriber set a property like myProperty=1234 then
call
con.subscribe() and I would like to receive a message like the
following :

<key oid='__sys__Event' contentMimeExtended='1.0'>
<org.xmlBlaster><event/></org.xmlBlaster>
</key>
<content size='23'>topic/*/event/subscribe</content>
<qos>
<clientProperty

name='_subscriptionId'>__subId:heron-1136812798913000000</clientProperty>
<clientProperty name='_nodeId'>heron</clientProperty>
<clientProperty name='_description'
encoding='base64'>...</clientProperty>
<clientProperty
name='_eventType'>topic/*/event/subscribe</clientProperty>
<clientProperty name='_summary'>New subscription of client
/node/heron/client/joe/1 on topic airport</clientProperty>
<clientProperty name='_publicSessionId'
type='long'>1</clientProperty>
<clientProperty name='_subjectId'>joe</clientProperty>
<clientProperty
name='_absoluteName'>/node/heron/client/joe/1</clientProperty>
<clientProperty name='_topicId'>airport</clientProperty>
<clientProperty name='myProperty'>1234</clientProperty>
</qos>

Is there any solution for my problem or any way to implement this
sort of
functionality ? Thanks.




--
Marcel Ruff
http://www.xmlBlaster.org
http://watchee.net
Phone: +49 7551 309371