Category Archives: Development

#Devoxx #takeaways

Last November was part of great conference in Antwerp, Belgium, believe most Java developers know it’s a Devoxx.

First of all thanks to organizers for such a great event and especially for the ability to free and almost instantly to access session recordings.

Here are some my takeaways to deep dive further.

The most interesting theme for me was attention to security, this topic was important and is becoming more and more important nowadays. So there are several related sessions to check out:

Fabric8 and OpenShift 3 was already on my radar, however Devoxx made me think more eagerly of it and here is a quicky on it

The next topic I’d like to deep dive a bit more is surprisingly JavaScript, right even if there a lot of pain points throwing by Java developers and here are some insights on it from Java world:

There was also huge attention to data streaming and related architectures

One more important point of software development is documentation and there was also attention to it:



Sample #Kafka producer with #Groovy

Here is a brief example of Kafka producer client written in Groovy:

import org.apache.kafka.clients.producer.Callback
import org.apache.kafka.clients.producer.KafkaProducer
import org.apache.kafka.clients.producer.ProducerRecord
import org.apache.kafka.clients.producer.RecordMetadata
@Grab(group = "org.apache.kafka", module = "kafka-clients", version = "")
@Grab(group = 'ch.qos.logback', module = 'logback-classic', version = '1.1.2')
Properties props = new Properties()
props.put('zk.connect', '')
props.put('bootstrap.servers', ',,')
props.put('key.serializer', 'org.apache.kafka.common.serialization.StringSerializer')
props.put('value.serializer', 'org.apache.kafka.common.serialization.StringSerializer')
def producer = new KafkaProducer(props)
def messageSender = { String topic, String message ->
    String key = new Random().nextLong()
    String compoundMessage = "key: $key, message: $message"
            new ProducerRecord<String, String>(topic, key, compoundMessage),
            { RecordMetadata metadata, Exception e ->
                println "The offset of the record we just sent is: ${metadata.offset()}"
            } as Callback
args.each { arg ->
    println "sending message $arg"
    messageSender('simple.topic', arg)

In order to run it use:

groovy producer.groovy hello from Groovy client