Replication: Register JMS receiver

XQuery code example to demonstrate how to register a replication listener.

Warning! For this function the user must be 'dba' or he must be in the 'jms' group.
Consult the Startup Triggers documentation to have the script executed when eXist-db is started.
(: 
 : Example: register replication receiver with configuration parameters 
 :)
xquery version "3.0";


import module namespace replication="http://exist-db.org/xquery/replication" 
              at "java:org.exist.jms.xquery.ReplicationModule"; 


let $jmsConfiguration := map {
        "java.naming.factory.initial" 
                := "org.apache.activemq.jndi.ActiveMQInitialContextFactory",
        "java.naming.provider.url" := "tcp://localhost:61616",
        "connection-factory" := "ConnectionFactory",
        "destination" := "dynamicTopics/eXistdb-replication-demo",
        "subscriber.name" := "SubscriptionId",
        "connection.client-id" := "ClientId"
    }
              
return
    replication:register($jmsConfiguration)