Created
February 24, 2013 18:54
-
-
Save Tingenek/5025014 to your computer and use it in GitHub Desktop.
1-wire to mqtt Camel route
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<route> | |
<!-- Read temperatures from the owfs directory structure. --> | |
<from uri="file:/Users/mark/work/test?noop=true&readLock=none&idempotent=false&delay=10000&antInclude=*/temperature&recursive=true" /> | |
<!-- Get temp and add date/time --> | |
<transform> | |
<simple>${bodyAs(String)} at ${date:now:yyyy-MM-dd hh:mm:ss}</simple> | |
</transform> | |
<log message="Got ${body} from ${file:parent}" /> | |
<!-- Send to topic temperatures/[position] where position taken from the file path --> | |
<recipientList ignoreInvalidEndpoints="true" > | |
<javaScript> | |
'mqtt:test?publishTopicName=temperatures.' + request.getHeaders().get('CamelFileName').split('/')[0]; | |
</javaScript> | |
</recipientList> | |
</route> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment