Skip to content

Commit

Permalink
Make auto-registration configurable
Browse files Browse the repository at this point in the history
Add boolean property for whether to add the loader as an extension at all,
as well as max redeliveries
  • Loading branch information
birkland committed Nov 9, 2016
1 parent 94dfc6a commit 809db12
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<cm:default-properties>
<cm:property name="input.uri" value="activemq:topic:fedora" />
<cm:property name="broker.uri" value="tcp://localhost:61616" />
<cm:property name="fcrepo.BaseURI" value="http://localhost:8080/fcrepo/rest" />
<cm:property name="fcrepo.baseURI" value="http://localhost:8080/fcrepo/rest" />
</cm:default-properties>
</cm:property-placeholder>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<cm:default-properties>
<cm:property name="loader.host" value="0.0.0.0" />
<cm:property name="loader.port" value="32080" />
<cm:property name="extension.load" value="true" />
<cm:property name="extension.load.maximumRediveries"
value="60" />
</cm:default-properties>
</cm:property-placeholder>

Expand All @@ -41,22 +44,31 @@
<camelContext id="apix-loader"
xmlns="http://camel.apache.org/schema/blueprint">
<routeBuilder ref="loaderRoutes" />

<!-- Self-register the loader service as an extension -->
<route id="load-extension">
<from uri="timer:register?repeatCount=1" />
<onException>
<exception>java.lang.Exception</exception>
<redeliveryPolicy maximumRedeliveries="10" logRetryAttempted="true" retryAttemptedLogLevel="INFO"/>
<redeliveryPolicy maximumRedeliveries="{{extension.load.maximumRediveries}}"
logRetryAttempted="true" retryAttemptedLogLevel="INFO" />
</onException>
<setHeader headerName="Content-Type">
<constant>text/plain</constant>
</setHeader>
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<setBody>
<simple>http://localhost:{{loader.port}}/load</simple>
</setBody>
<to
uri="jetty:http://localhost:{{loader.port}}/load?okStatusCodeRange=200-399" />
<choice>
<when>
<simple>{{extension.load}}</simple>
<to
uri="jetty:http://localhost:{{loader.port}}/load?okStatusCodeRange=200-399" />
</when>
</choice>
</route>
</camelContext>
</blueprint>

0 comments on commit 809db12

Please sign in to comment.