Apache Camel: First IOTA Component Example
INTRODUCTION
I am proud to comunicate that Apache Camel since version 2.24 will support IOTA DLT Component (I’m the author)
Apache Camel is a open source implementation of famous Enterprise Integration Patterns. Camel is a Routing and Mediation Engine and facilitates the developers to create routes and mediation rules in variety of Domain Specific language(DSL) such as java, Spring/XML, Scala etc.
TUTORIAL
Into this blog article i will explain how to create a simple project to send data from MQTT to IOTA Tangle!
Create java project
To create java project you can use maven archetypes
mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes \ -DarchetypeArtifactId=camel-archetype-spring -DarchetypeVersion=2.22.0 \ -DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
Inside the folder src/main/resources/META-INF/spring can find the main file camel-context.xml
POM dependencies
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-mqtt</artifactId> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-iota</artifactId> </dependency>
Note: You must upgrade camel version form 2.22.0 to 2.24.0-SNAPSHOT
Write the code
Now is let time to edit the file to write data to the tangle.