{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls/comments/92734860","pull_request_review_id":13256106,"id":92734860,"diff_hunk":"@@ -0,0 +1,85 @@\n+// Copyright (c) Microsoft. All rights reserved.\n+\n+package com.microsoft.azure.iot.kafka.connect\n+\n+import java.time.Instant\n+import java.util.Date\n+\n+import com.microsoft.azure.servicebus.amqp.AmqpConstants\n+import org.apache.kafka.connect.data.{Schema, SchemaBuilder, Struct}\n+\n+import scala.collection.JavaConverters._\n+import scala.reflect.ClassTag\n+\n+object IotMessageConverter {\n+\n+  // Public for testing purposes\n+  lazy val schema: Schema = SchemaBuilder.struct()\n+    .name(schemaName)\n+    .version(schemaVersion)\n+    .field(deviceIdKey, Schema.STRING_SCHEMA)\n+    .field(offsetKey, Schema.STRING_SCHEMA)\n+    .field(contentTypeKey, Schema.OPTIONAL_STRING_SCHEMA)\n+    .field(enqueuedTimeKey, Schema.STRING_SCHEMA)\n+    .field(sequenceNumberKey, Schema.INT64_SCHEMA)\n+    .field(contentKey, Schema.STRING_SCHEMA)\n+    .field(systemPropertiesKey, propertiesMapSchema)\n+    .field(propertiesKey, propertiesMapSchema)\n+\n+  private lazy val propertiesMapSchema: Schema = SchemaBuilder.map(Schema.STRING_SCHEMA, Schema.STRING_SCHEMA)\n+\n+  val offsetKey = \"offset\"","path":"src/main/scala/com/microsoft/azure/iot/iothub2kafka/IotMessageConverter.scala","position":null,"original_position":31,"commit_id":"570155dbfca3e538e74e64a7e5c2d38825afb734","original_commit_id":"c534bd0780129c865a6826dc4f3915e76847c555","user":{"login":"varunpuranik","id":8727929,"avatar_url":"https://avatars.githubusercontent.com/u/8727929?v=3","gravatar_id":"","url":"https://api.github.com/users/varunpuranik","html_url":"https://github.com/varunpuranik","followers_url":"https://api.github.com/users/varunpuranik/followers","following_url":"https://api.github.com/users/varunpuranik/following{/other_user}","gists_url":"https://api.github.com/users/varunpuranik/gists{/gist_id}","starred_url":"https://api.github.com/users/varunpuranik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varunpuranik/subscriptions","organizations_url":"https://api.github.com/users/varunpuranik/orgs","repos_url":"https://api.github.com/users/varunpuranik/repos","events_url":"https://api.github.com/users/varunpuranik/events{/privacy}","received_events_url":"https://api.github.com/users/varunpuranik/received_events","type":"User","site_admin":false},"body":"The ide had formatted it like that. Fixed.","created_at":"2016-12-16T01:15:35Z","updated_at":"2016-12-16T01:15:35Z","html_url":"https://github.com/Azure/toketi-kafka-connect-iothub/pull/2#discussion_r92734860","pull_request_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls/comments/92734860"},"html":{"href":"https://github.com/Azure/toketi-kafka-connect-iothub/pull/2#discussion_r92734860"},"pull_request":{"href":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls/2","id":98080385,"html_url":"https://github.com/Azure/toketi-kafka-connect-iothub/pull/2","diff_url":"https://github.com/Azure/toketi-kafka-connect-iothub/pull/2.diff","patch_url":"https://github.com/Azure/toketi-kafka-connect-iothub/pull/2.patch","issue_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/issues/2","number":2,"state":"open","locked":false,"title":"Schema update for IoT messages","user":{"login":"varunpuranik","id":8727929,"avatar_url":"https://avatars.githubusercontent.com/u/8727929?v=3","gravatar_id":"","url":"https://api.github.com/users/varunpuranik","html_url":"https://github.com/varunpuranik","followers_url":"https://api.github.com/users/varunpuranik/followers","following_url":"https://api.github.com/users/varunpuranik/following{/other_user}","gists_url":"https://api.github.com/users/varunpuranik/gists{/gist_id}","starred_url":"https://api.github.com/users/varunpuranik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varunpuranik/subscriptions","organizations_url":"https://api.github.com/users/varunpuranik/orgs","repos_url":"https://api.github.com/users/varunpuranik/repos","events_url":"https://api.github.com/users/varunpuranik/events{/privacy}","received_events_url":"https://api.github.com/users/varunpuranik/received_events","type":"User","site_admin":false},"body":"- Updated the schema of the IotMessage so that the system properties\r\nare structured into the source record being sent to the Kafka Connector.\r\n- Changed exceptions thrown from IotHub to be ConnectExceptions to give\r\ncorrect behavior in Kafka Connect\r\n- Added additional tests for schema changes and also to show usage of\r\nStartTime for the connector","created_at":"2016-12-15T03:20:18Z","updated_at":"2016-12-16T01:15:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"abe8fe3f1faae3fd057d2da5f18661bb95a27a4a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/issues/2/comments","statuses_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/statuses/570155dbfca3e538e74e64a7e5c2d38825afb734","head":{"label":"Azure:dev-schemaupdate","ref":"dev-schemaupdate","sha":"570155dbfca3e538e74e64a7e5c2d38825afb734","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":75020889,"name":"toketi-kafka-connect-iothub","full_name":"Azure/toketi-kafka-connect-iothub","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/toketi-kafka-connect-iothub","description":"Kafka Connect IoT Hub is a Kafka source connector for pumping data from Azure IoT Hub to Kafka.","fork":false,"url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub","forks_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/forks","keys_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/teams","hooks_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/hooks","issue_events_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/events","assignees_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/tags","blobs_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/languages","stargazers_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/stargazers","contributors_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/contributors","subscribers_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/subscribers","subscription_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/subscription","commits_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/merges","archive_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/downloads","issues_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/labels{/name}","releases_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/deployments","created_at":"2016-11-28T22:43:22Z","updated_at":"2016-12-12T16:15:52Z","pushed_at":"2016-12-16T01:14:20Z","git_url":"git://github.com/Azure/toketi-kafka-connect-iothub.git","ssh_url":"git@github.com:Azure/toketi-kafka-connect-iothub.git","clone_url":"https://github.com/Azure/toketi-kafka-connect-iothub.git","svn_url":"https://github.com/Azure/toketi-kafka-connect-iothub","homepage":null,"size":29,"stargazers_count":8,"watchers_count":8,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":8,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"2a30a5dda43a61f4f39b8c45fc28aef1c5fd3c34","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":75020889,"name":"toketi-kafka-connect-iothub","full_name":"Azure/toketi-kafka-connect-iothub","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/toketi-kafka-connect-iothub","description":"Kafka Connect IoT Hub is a Kafka source connector for pumping data from Azure IoT Hub to Kafka.","fork":false,"url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub","forks_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/forks","keys_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/teams","hooks_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/hooks","issue_events_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/events","assignees_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/tags","blobs_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/languages","stargazers_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/stargazers","contributors_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/contributors","subscribers_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/subscribers","subscription_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/subscription","commits_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/merges","archive_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/downloads","issues_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/labels{/name}","releases_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/deployments","created_at":"2016-11-28T22:43:22Z","updated_at":"2016-12-12T16:15:52Z","pushed_at":"2016-12-16T01:14:20Z","git_url":"git://github.com/Azure/toketi-kafka-connect-iothub.git","ssh_url":"git@github.com:Azure/toketi-kafka-connect-iothub.git","clone_url":"https://github.com/Azure/toketi-kafka-connect-iothub.git","svn_url":"https://github.com/Azure/toketi-kafka-connect-iothub","homepage":null,"size":29,"stargazers_count":8,"watchers_count":8,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls/2"},"html":{"href":"https://github.com/Azure/toketi-kafka-connect-iothub/pull/2"},"issue":{"href":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/issues/2"},"comments":{"href":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/toketi-kafka-connect-iothub/statuses/570155dbfca3e538e74e64a7e5c2d38825afb734"}}}}
{"actor":{"display_login":"varunpuranik"}}