Skip to content

Commit b4f2129

Browse files
authored
Merge pull request #19 from mmolimar/develop
Release version 1.2.0 with ksqlDB 5.4.0
2 parents a28d17e + 15c2dcb commit b4f2129

34 files changed

+1210
-546
lines changed

.travis.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
language: scala
2+
scala:
3+
- 2.12.10
4+
jdk:
5+
- openjdk8
16
script:
27
- sbt clean coverage test it:test coverageReport && sbt coverageAggregate
38
after_success:
4-
- sbt coveralls
9+
- sbt coveralls

README.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# KSQL JDBC Driver [![Build Status](https://travis-ci.org/mmolimar/ksql-jdbc-driver.svg?branch=master)](https://travis-ci.org/mmolimar/ksql-jdbc-driver)[![Coverage Status](https://coveralls.io/repos/github/mmolimar/ksql-jdbc-driver/badge.svg?branch=master)](https://coveralls.io/github/mmolimar/ksql-jdbc-driver?branch=master)
1+
# ksqlDB JDBC Driver [![Build Status](https://travis-ci.org/mmolimar/ksql-jdbc-driver.svg?branch=master)](https://travis-ci.org/mmolimar/ksql-jdbc-driver)[![Coverage Status](https://coveralls.io/repos/github/mmolimar/ksql-jdbc-driver/badge.svg?branch=master)](https://coveralls.io/github/mmolimar/ksql-jdbc-driver?branch=master)
22

3-
**ksql-jdbc-driver** is a Type 3 Java Database Connectivity (JDBC) driver that provides standard access to
3+
**ksql-jdbc-driver** is a Type 4 Java Database Connectivity (JDBC) driver that provides standard access to
44
Apache Kafka via JDBC API.
55

6-
In the current version, the driver connects to the [KSQL engine](https://www.confluent.io/product/ksql/) to
7-
perform queries to Kafka and then, the engine translates those requests to Kafka requests.
6+
The driver connects to the [ksqlDB engine](https://ksqldb.io/) then, the engine translates those requests
7+
to Kafka requests.
88

99
## Getting started
1010

1111
### Building from source ###
1212

13-
Just clone the ksql-jdbc-driver repo and package it:
14-
13+
Just clone the ``ksql-jdbc-driver`` repo and package it:
14+
1515
``git clone https://github.com/mmolimar/ksql-jdbc-driver.git && cd ksql-jdbc-driver``
1616

1717
``sbt clean package``
@@ -37,7 +37,7 @@ To know the test coverage of the driver:
3737

3838
As expected, the driver can be used as we are used to. So, in your application, register the driver (depending on
3939
your JVM), for example:
40-
40+
4141
* ``java.sql.DriverManager.registerDriver(new com.github.mmolimar.ksql.jdbc.KsqlDriver)``
4242

4343
or
@@ -46,16 +46,17 @@ or
4646

4747
### Connection URL
4848

49-
The URL has the form ``jdbc:ksql://<ksql-engine>:<port>[?<property1>=<value>&<property2>=<value>...]``
49+
The URL has the form ``jdbc:ksql://[<username>:<password>@]<ksql-engine>:<port>[?<property1>=<value>&<property2>=<value>...]``
5050

5151
where:
5252

53-
* **\<ksql-engine>**: represents the KSQL engine host.
54-
* **\<port>**: is the KSQL engine port.
53+
* **\<username>:\<password>**: optional username and password to log into ksqlDB.
54+
* **\<ksql-engine>**: represents the ksqlDB engine host.
55+
* **\<port>**: ksqlDB engine port.
5556
* **\<propertyN>**: are the custom client properties (optionals). Available properties:
56-
* ``secured``: sets if the KSQL connection is secured or not. It's a boolean (``true``|``false``) and its default
57+
* ``secured``: sets if the ksqlDB connection is secured or not. It's a boolean (``true``|``false``) and its default
5758
value is ``false``.
58-
* ``properties``: enables to set in KSQL extra properties from the JDBC URL. It's a boolean (``true``|``false``)
59+
* ``properties``: enables to set in ksqlDB extra properties from the JDBC URL. It's a boolean (``true``|``false``)
5960
and its default value is ``false``.
6061
* ``timeout``: sets the max wait time between each message when receiving them. It's a long and its default
6162
value is ``0`` which means that is infinite.

build.sbt

+37-16
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,46 @@
1-
name := "ksql-jdbc-driver"
1+
val projectVersion = "1.2.0"
2+
val projectScalaVersion = "2.12.10"
3+
val ksqlVersion = "5.4.0"
4+
val kafkaVersion = "2.4.0"
5+
val scalaTestVersion = "3.1.0"
6+
val scalaMockVersion = "3.6.0"
7+
val wsApiVersion = "2.1.1"
28

3-
version := "1.1"
9+
val repos = Seq(
10+
"Confluent Maven Repo" at "https://packages.confluent.io/maven/",
11+
"Confluent Snapshots Maven Repo" at "https://s3-us-west-2.amazonaws.com/confluent-snapshots/",
12+
Resolver.mavenLocal
13+
)
414

5-
initialize := {
6-
assert(Integer.parseInt(sys.props("java.specification.version").split("\\.")(1)) >= 8, "Java 8 or above required")
7-
}
8-
9-
scalaVersion := "2.11.11"
15+
val dependencies = Seq(
16+
"io.confluent.ksql" % "ksql-rest-app" % ksqlVersion,
17+
"org.apache.kafka" %% "kafka" % kafkaVersion % "test",
18+
"org.scalatest" %% "scalatest" % scalaTestVersion % "test",
19+
"org.scalamock" %% "scalamock-scalatest-support" % scalaMockVersion % "test",
20+
"javax.ws.rs" % "javax.ws.rs-api" % wsApiVersion artifacts Artifact("javax.ws.rs-api", "jar", "jar")
21+
)
1022

11-
resolvers += "Confluent Maven Repo" at "http://packages.confluent.io/maven/"
12-
resolvers += "Confluent Snapshots Maven Repo" at "https://s3-us-west-2.amazonaws.com/confluent-snapshots/"
13-
resolvers += Resolver.mavenLocal
23+
val common = Seq(
24+
organization := "com.github.mmolimar",
25+
name := "ksql-jdbc-driver",
26+
version := projectVersion,
27+
scalaVersion := projectScalaVersion,
28+
crossScalaVersions := Seq("2.11.12", projectScalaVersion),
29+
resolvers ++= repos,
30+
libraryDependencies ++= dependencies
31+
)
1432

15-
libraryDependencies += "io.confluent.ksql" % "ksql-rest-app" % "5.3.0"
16-
libraryDependencies += "org.apache.kafka" %% "kafka" % "2.3.0" % "test"
17-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.8" % "test"
18-
libraryDependencies += "org.scalamock" %% "scalamock-scalatest-support" % "3.6.0" % "test"
19-
libraryDependencies += "javax.ws.rs" % "javax.ws.rs-api" % "2.1.1" artifacts Artifact("javax.ws.rs-api", "jar", "jar")
33+
lazy val root = project.in(file("."))
34+
.configs(Configs.all: _*)
35+
.settings(
36+
common,
37+
Tests.settings
38+
)
39+
.enablePlugins(ScoverageSbtPlugin, CoverallsPlugin, AssemblyPlugin)
2040

2141
assemblyMergeStrategy in assembly := {
22-
case PathList("javax", "inject", xs@_*) => MergeStrategy.first
42+
case PathList("javax", "inject", _*) => MergeStrategy.first
43+
case PathList("javax", "annotation", _*) => MergeStrategy.first
2344
case "module-info.class" => MergeStrategy.discard
2445
case "log4j.properties" => MergeStrategy.discard
2546
case x =>

project/Build.scala

-7
This file was deleted.

project/Configs.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import sbt._
22

33
object Configs {
44
val IntegrationTest = config("it") extend (Test)
5-
val all = Seq(IntegrationTest)
5+
val all: Seq[Configuration] = Seq(IntegrationTest)
66
}
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
import sbt.Keys._
2-
import sbt._
2+
import sbt.{Def, _}
33

4-
object Testing {
4+
object Tests {
55

66
import Configs._
77

88
private lazy val testSettings = Seq(
99
fork in Test := false,
1010
parallelExecution in Test := false
1111
)
12-
13-
lazy val testAll = TaskKey[Unit]("test-all")
14-
1512
private lazy val itSettings = inConfig(IntegrationTest)(Defaults.testSettings) ++ Seq(
1613
fork in IntegrationTest := false,
1714
parallelExecution in IntegrationTest := false,
1815
scalaSource in IntegrationTest := baseDirectory.value / "src/it/scala"
1916
)
17+
private lazy val testAll = TaskKey[Unit]("testAll", "Executes unit and integration tests.")
2018

21-
lazy val settings = testSettings ++ itSettings ++ Seq(
22-
testAll := (),
23-
testAll <<= testAll.dependsOn(test in IntegrationTest),
24-
testAll <<= testAll.dependsOn(test in Test)
19+
lazy val settings: Seq[Def.Setting[_]] = testSettings ++ itSettings ++ Seq(
20+
testAll := (test in Test).dependsOn(test in IntegrationTest).value
2521
)
2622
}

project/build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version = 0.13.9
1+
sbt.version = 1.3.6

project/plugins.sbt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
logLevel := Level.Warn
22

3-
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
4-
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.2")
5-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")
3+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
4+
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.7")
5+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")

src/it/resources/log4j.properties

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
log4j.rootLogger=INFO, stdout
2+
3+
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
4+
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
5+
log4j.appender.stdout.layout.ConversionPattern=[%d] %p %c{1}:%L - %m%n
6+
7+
log4j.logger.kafka=ERROR, stdout
8+
log4j.logger.org.apache.zookeeper=ERROR, stdout
9+
log4j.logger.org.apache.kafka=ERROR, stdout
10+
log4j.logger.org.I0Itec.zkclient=ERROR, stdout
11+
log4j.logger.org.reflections=ERROR, stdout

0 commit comments

Comments
 (0)