Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Kai	Wähner
Technology	Evangelist
kontakt@kai-waehner.de
LinkedIn	
@KaiWaehner
www.kai-waehner.de
January	2017
Development	...
© Copyright 2000-2016 TIBCO Software Inc.
This is not an introduction to Open Source IoT Project Flogo
www.flogo.io
https:...
© Copyright 2000-2016 TIBCO Software Inc.
• is very easy, fast and lightweight
• can be done without much experience in Go...
Flogo Concepts
Trigger
Flow
Activity
Error Handler
Flogo App
One or more Flows
Flows
Activities + Transitions +
Optional e...
Flogo Repositories on Github
flogo-lib
Core libraries.
flogo-services
Backing services required by Flogo for flow
and stat...
© Copyright 2000-2016 TIBCO Software Inc.
Apache Kafka
https://kafka.apache.org/
“Kafka is used for building real-time
dat...
© Copyright 2000-2016 TIBCO Software Inc.
• Get Access to a technology which you want to integrate
• For Kafka, this could...
© Copyright 2000-2016 TIBCO Software Inc.
Live Demo
Development of a Flogo Activity for Apache Kafka
© Copyright 2000-2016 TIBCO Software Inc.
• is very easy, fast and lightweight
• can be done without much experience in Go...
Questions? Please contact me!
Kai Wähner
Technology Evangelist
kontakt@kai-waehner.de
@KaiWaehner
www.kai-waehner.de
Linke...
Upcoming SlideShare
Loading in …5
×

Open Source IoT Project Flogo - Building a Custom Apache Kafka Connector

629 views

Published on

How to develop a custom connector for IoT Project Flogo?

This video demonstrates how build a custom Flogo Adapter / Connector quickly and easily for any kind of technology or interface. In Flogo terms, this is either a Trigger (to initiate and start a new Flogo flow from an interface) or an Activity (to send a message to an interface). This video shows how to use Golang to build a Flogo Activity to send messages to Apache Kafka. Note that building a Trigger can be done with the same procedure as described here.

The source code can be found here: https://github.com/kwaehner/flogo/tree/master/activity/kafka (I will also contribute it to the Flogo project, of course).

Any feedback or questions are highly appreciated. Please use the Flogo Community Q&A to ask questions or discuss concepts or use cases for Flogo: https://community.tibco.com/products/project-flogo

A video recording with live demo can be found here: https://youtu.be/NScV3v8A6Mk

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Open Source IoT Project Flogo - Building a Custom Apache Kafka Connector

  1. 1. Kai Wähner Technology Evangelist kontakt@kai-waehner.de LinkedIn @KaiWaehner www.kai-waehner.de January 2017 Development of a Custom Flogo Connector (using Apache Kafka as example)
  2. 2. © Copyright 2000-2016 TIBCO Software Inc. This is not an introduction to Open Source IoT Project Flogo www.flogo.io https://community.tibco.com/wiki/flogo- introduction-slides-and-videos
  3. 3. © Copyright 2000-2016 TIBCO Software Inc. • is very easy, fast and lightweight • can be done without much experience in Go programming language • is best done by using other Flogo connectors (and unit tests) as template • should be contributed to the Flogo open source community (not a must, of course!) Key Takeaways Building custom Flogo connectors…
  4. 4. Flogo Concepts Trigger Flow Activity Error Handler Flogo App One or more Flows Flows Activities + Transitions + Optional error handler Triggers Starts those flows
  5. 5. Flogo Repositories on Github flogo-lib Core libraries. flogo-services Backing services required by Flogo for flow and state management. flogo-contrib Flogo extensions available out of the box, like triggers or activities. flogo-cli A command line tool to build Flogo apps. https://github.com/TIBCOSoftware/flogo (very permissive open source BSD license) This projects includes Triggers and Activities go get github.com/TIBCOSoftware/flogo-contrib/...
  6. 6. © Copyright 2000-2016 TIBCO Software Inc. Apache Kafka https://kafka.apache.org/ “Kafka is used for building real-time data pipelines and streaming apps. It is horizontally scalable, fault-tolerant, wicked fast, and runs in production in thousands of companies.”
  7. 7. © Copyright 2000-2016 TIBCO Software Inc. • Get Access to a technology which you want to integrate • For Kafka, this could be a locally installed broker, or a remote connection • Find, install and use a corresponding Go library • Various Golang APIs are available for Apache Kafka • I chose the Kafka API from optiopay because it is very simply and easy to use – depending on requirements regarding functionality, performance or maturity, other options might be better (I did not do more research) • Install the library into your Go workspace (command ‘go install’) • Run an “hello world“ example (optiopay delivers a very nice simple demo where you send and consume messages from command line) • Duplicate an existing Flogo Activity • Choose a similar Flogo Activity (e.g. Kafka is similar to MQTT, you connect to a broker and send messages) • The folder includes implementation, test, runtime config and UI config • Use the existing folder as template and re-write / update / replace / enhance the code + config + test • Run “go test” to validate correctness of the new connector • In my Kafka test, I see that the test sends a new message to Kafka (verified in a Kafka consumer running on the command line) • Deploy and test the new connector in the Flogo Web UI • The web UI allows to install a new activity (or trigger) via URL Link (you need to publish your connector on Github) • Github Pull Request to contribute your code back to the Flogo community • (optional step, but highly recommended J) Steps to develop a custom connector
  8. 8. © Copyright 2000-2016 TIBCO Software Inc. Live Demo Development of a Flogo Activity for Apache Kafka
  9. 9. © Copyright 2000-2016 TIBCO Software Inc. • is very easy, fast and lightweight • can be done without much experience in Go programming language • is best done by using other Flogo connectors (and unit tests) as template • should be contributed to the Flogo open source community (not a must, of course!) Key Takeaways Building custom Flogo connectors…
  10. 10. Questions? Please contact me! Kai Wähner Technology Evangelist kontakt@kai-waehner.de @KaiWaehner www.kai-waehner.de LinkedIn Ask questions on the Flogo community: https://community.tibco.com/products/project-flogo

×