Asim,
I would consider using the content processing framework (CPF) instead of plain
triggers, since you can leverage the framework to write a more reliable jms
client (in your current implementation, if the servlet is down or can't be
reached, then the post will fail and the document won't be sent to the JMS
recipients). In CPF you can easily keep track of the status of each document,
so you could recover from these kinds of failures.
I briefly looked at the code, and have a couple of suggestions:
* using direct element constructors instead of unquoting a string
representation of an xml document, so I'd write (in the setup.xqy):
let $file := <jms id="mljmsConfig-example-1.xml">
<url>http://localhost:8080/mljms/mljms</url>
<user>admin</user>
<pass></pass>
<type>queue</type>
<destination>test.queue</destination>
<props><JMSType>SomeType</JMSType>
<JMSTimeToLive>0</JMSTimeToLive><JMSPriority>5</JMSPriority>
<JMSDeliveryMode>Non-persistent</JMSDeliveryMode></props>
</jms>
Instead of
let $file := xdmp:unquote("<jms...")
* The post will only work for xml documents (not binaries). Perhaps it
should have a check to prevent a run time error, or you could encode binaries.
Silvano
________________________________
From: [email protected]
[mailto:[email protected]] On Behalf Of asim
Sent: Wednesday, July 08, 2009 6:01 AM
To: [email protected]
Subject: [MarkLogic Dev General] MarkLogic + JMS
Hi,
I have put up an articles + source code on how to use Marklogic triggers to
dispatch content onto JMS
(https://resources.riskfocusinc.com/portal/display/ART/MLJMS+-+JMS+Driver+for+MarkLogic).
I would appreciate some thoughts on this, mainly on the Marklogic side.
Asim
Asim Malik
Risk Focus Inc.
Mobile: +44 7919 073 937
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general