Usage examples for the Kafka createDirectStream / createRDD api that I contributed to Spark (available since Spark 1.3)
For more detail, see the blog post or the slides or the jira ticket
If you want to try running this,
schema.sql contains postgres schemas for the tables used
src/main/resources/application.conf contains jdbc and kafka config info
The examples are indifferent to the exact kafka topic or message format used, although IdempotentExample assumes each message body is unique.