Skip to content

Instantly share code, notes, and snippets.

Martin Krasser krasserm

Block or report user

Report or block krasserm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:9c9651a9423f9d8e2381d1922f9d88ed
import java.nio.ByteBuffer
import java.util.concurrent.TimeUnit
import org.apache.kafka.clients._
import org.apache.kafka.common.metrics.{MetricConfig, Metrics, MetricsReporter}
import org.apache.kafka.common.network.Selector
import org.apache.kafka.common.protocol.ApiKeys
import org.apache.kafka.common.record.{CompressionType, MemoryRecords}
import org.apache.kafka.common.requests.{ProduceRequest, RequestSend}
import org.apache.kafka.common.utils.SystemTime
View keybase.md

Keybase proof

I hereby claim:

  • I am krasserm on github.
  • I am krasserm (https://keybase.io/krasserm) on keybase.
  • I have a public key whose fingerprint is B785 7B59 B25E 2385 5450 DE4C F23C A996 D0CF F605

To claim this, I am signing this object:

@krasserm
krasserm / akka-persistence-plugins.md
Last active Mar 27, 2017
Akka Persistence Plugins
View akka-persistence-plugins.md
View akka-persistence-es.scala
import akka.actor._
import akka.persistence._
object EventsourcingExample extends App {
class EventsourcedProcessor extends Processor {
var events: List[Any] = Nil
var awaitStack: List[Actor.Receive] = Nil
def receive = {
case Persistent(event, _) if recoveryRunning update(event)
@krasserm
krasserm / example1.scala
Last active Dec 17, 2015
Eventsourced processors in a parent-child relationship
View example1.scala
import java.io.File
import scala.concurrent.duration._
import akka.actor._
import akka.util.Timeout
import org.eligosource.eventsourced.core._
import org.eligosource.eventsourced.journal.leveldb.LeveldbJournalProps
@krasserm
krasserm / parwrite.scala
Created Feb 3, 2013
Journal parallel writes prototype
View parwrite.scala
package example
import scala.concurrent._
import scala.concurrent.duration._
import akka.actor._
import akka.pattern.ask
import akka.util.Timeout
object Parwrite extends App {
@krasserm
krasserm / es-ext-01.scala
Last active Dec 12, 2015
Event sourcing and external servce integration (blog post snippets)
View es-ext-01.scala
case class Order(id: Int = -1, details: String,
creditCardNumber: String,
creditCardValidation: Validation = Validation.Pending)
sealed trait Validation
object Validation {
case object Pending extends Validation
case object Success extends Validation
case object Failure extends Validation
}
@krasserm
krasserm / play-01.scala
Created Feb 23, 2012
JAXB-based XML and JSON APIs
View play-01.scala
object Application extends Controller with JaxbSupport {
val paths: String = // colon-separated list of packages containing JAXB-annotated classes ...
val config: JSONConfiguration = // ...
// can be used for JAXB-based JSON and XML processing
implicit val context = new JSONJAXBContext(config, paths)
...
}
@krasserm
krasserm / jaxb-01.scala
Created Feb 23, 2012
JAXB-based XML and JSON APIs
View jaxb-01.scala
import javax.xml.bind.annotation._
@XmlRootElement(name = "person")
@XmlAccessorType(XmlAccessType.FIELD)
case class Person(fullname: String, username: Option[String], age: Int)
You can’t perform that action at this time.