Skip to content

Simple program to fetch data from one Kafka topic, and send it to Watson, pretending we are an IOT Gateway.

Notifications You must be signed in to change notification settings

klyr/kafka-to-watson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Kafka to Watson

Simple program to fetch data from one Kafka topic, and send it to IBM Watson, pretending we are an IOT Gateway.

The kafka message MUST be of the form:

{
    "DeviceType": "...",
    "DeviceId": "...",
    "Event": "...",
    "Message": { ... }
}

it describes the device to impersonate.

Usage

kafka-to-watson <broker1,...,brokerN> <topic1,...,topicN> <watson-org> <watson-gw-type> <watson-gw-id> <watson-gw-token>

Example

  1. Start the kafka consumer:

     ./kafka-to-watson 127.0.0.1:9092 watson tpktfp CurlGatewayType CurlGateway 'XXX...YYY'
    
  2. Push a message to the watson kafka topic:

     kafkacat -P -t 'watson' -b localhost:9092 <<< '{"DeviceType": "Thermometer", "DeviceId": "th032", "Event": "newState", "Message": {"temp":40}}'
    

TODO

  • HTTP Watson client
  • MQTT Watson client

About

Simple program to fetch data from one Kafka topic, and send it to Watson, pretending we are an IOT Gateway.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages