Although its rare, but there are times when you actually want to see errors in your code – more importantly, at the right time !

Kafka Go Producer behaviour

You need to be mindful of this while using the Kafka Go client producer. For e.g. if you were to supply an incorrect value for the Kafka broker …

no error

… assuming you don’t have a Kafka broker at foo:9092, you would expect that the above code will respond with producer creation failed along with the specific error details. Instead, the flow carries on and ends by printing done. This is because the error returned by Produce is only in case message does not get enqueued to the internal librdkafka queue

You should…

Hook up to the delivery producer reports channel (using Producer.Events()) in order to catch this error – better late than never right !

Now, the error is rightfully returned – producer error foo:9092/bootstrap: Failed to resolve 'foo:9092': nodename nor servname provided, or not known (after 1543569582778ms in state INIT)

You can also provide your own channel to the Produce method to receive delivery events. Only the error is handled and the other possible event i.e. *kafka.Message is ignored under the default case umbrella

I am happy to announce that the first few chapters of Practical Redisare now available

About Practical Redis

It is a hands-on, code-driven guide to Redis where each chapter is based on an application (simple to medium complexity) which demonstrates the usage of Redis and its capabilities (data structures, commands etc.).

The applications in the book are based on Java and Golang. The Java based Redis client libraries which have been used in this book include Jedis, Redisson and Lettuce while go-redis is used as the client library for Golang. Docker and Docker Compose are used to deploy the application stack (along with Redis)

Redis: the basic data structures – intro to core Redis data structures with a Java based news sharing app using the Jedisclient

Extending Redis with Redis Modules – learn about the basics of Redis Modules and make use of ReBloom in a Go based recommendation service

Tweet analysis service – keep track of relevant tweets using a Java and Go based application which ingests tweets, consumes/processes them and produces queryable info in real time using reliable queues (Redis LISTs), SETs and HASHes

Coming soon …

The below chapters are work in progress on and will be made available in subsequent releases of this book

Pipelines and Transactions in Redis

Scalable chat application – Use Redis PubSub and Websocket to create a chat service