Created
March 5, 2018 03:51
-
-
Save mtranter/3fc613d63ce584adba28bc81e1622331 to your computer and use it in GitHub Desktop.
Kafka Streams Scala Stack Overflow Issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name := "kstreams-scala-recusion" | |
version := "0.1" | |
scalaVersion := "2.12.4" | |
libraryDependencies ++= Seq( | |
"com.lightbend" %% "kafka-streams-scala" % "0.1.2" exclude("org.slf4j", "slf4j-log4j12"), | |
"org.scalatest" %% "scalatest" % "3.0.5" % "test" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.recursion | |
import com.lightbend.kafka.scala.streams.StreamsBuilderS | |
import org.apache.kafka.streams.kstream.Materialized | |
object Streams { | |
def build() = { | |
val sb = new StreamsBuilderS() | |
sb.table[String, String]("topic").filter((k,v) => v.length > 0, Materialized.as("STACKOVERFLOW")) | |
sb | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.recursion | |
import org.scalatest.{Matchers, WordSpec} | |
class StreamsSpec extends WordSpec with Matchers { | |
"The Filter Method" should { | |
"throw StackOverflow" in { | |
assertThrows[StackOverflowError] { | |
Streams.build() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment