Skip to content

Instantly share code, notes, and snippets.

@unicolet
Created February 6, 2015 10:39
Show Gist options
  • Select an option

  • Save unicolet/42608c4cded7fe7d4252 to your computer and use it in GitHub Desktop.

Select an option

Save unicolet/42608c4cded7fe7d4252 to your computer and use it in GitHub Desktop.
<!--
starts first, then stops. All other routes start after this one has completed
Same as: curl -XPUT http://localhost:9200/_template/opennms -d @elmapping.json
-->
<route id="elastisearchTemplateMapping" autoStartup="true" startupOrder="1">
<from uri="timer://runOnce?repeatCount=1&amp;delay=0"/>
<setHeader headerName="CamelHttpMethod">
<constant>PUT</constant>
</setHeader>
<setHeader headerName="CamelContentType">
<constant>application/x-www-form-urlencoded</constant>
</setHeader>
<setBody>
<groovy>new File('elmapping.json').text</groovy>
</setBody>
<to uri="http:127.0.0.1:9200/_template/opennms"/>
<log message="${body}"/>
</route>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment