-
-
Notifications
You must be signed in to change notification settings - Fork 7
Startup Triggers
In conf.xml two different types of StartupTriggers can be defined to ensure a JMS listener is available after database startup.
Arbitrary xquery scripts can be launched automatically from the /db/system/autostart collection. Scripts can start both messaging and replication listeners.
The template is already available in conf.xml (must be removed from comments). The Trigger created the collection with the correct permissions at the first startup. Note that for security reasons the rules regarding the permissions are rather 'strict'.
<!--
XQueryStartupTrigger will execute all xquery scripts stored in the
/db/system/autostart collection during startup of the database.
The collection must be owned by SYSTEM/DBA mode "rwxrwx___" (0770)
Each of the scripts must be owned by a DBA user, group DBA,
mode "rwxrwx___" (0770) with mime-type "application/xquery".
The name of the scripts must end with ".xq", ".xqy" or ".xquery".
-->
<trigger class="org.exist.collections.triggers.XQueryStartupTrigger"/>For older versions of eXist-db the trigger was part of the first implementations of the replication/messaging extension;
this feature has been removed with v0.9.0
<startup>
<triggers>
<trigger class="org.exist.messaging.receive.XqueryStartupTrigger">
<parameter name="xquery" value="/db/script1.xq"/>
<parameter name="xquery" value="/db/script2.xq"/>
</trigger>
</triggers>
</startup>Please note that the org.exist.messaging.receive.XqueryStartupTrigger will not work when the extension is executed from a XAR file. For this the JAR files of the XAR must be extracted into lib/user