Dynamic Kafka Topics in Quarkus

Previously I posted on using the Apache KafkaProducer to route events to Kafka topics dynamically, but there’s a better way. The KafkaProducer is pretty much obsolete since Quarkus 2, and all metadata is ignored. I ended up with serialization issues. The solution is to use a standard Emitter, and add metadata to your message. For […]

Simple Annotation Processor

I recently needed to develop an annotation processor in Kotlin, posting here for future reference. This is the class level annotation: And here is the declaration of the annotation processor: Followed by the usual overrides: These fields keep track of what has been processed: The process method: identifies types to process, and extracts configuration information. […]

Reverse Double Linked List in C#

This is a question that often comes up in an interview. The solution is simple. To begin with, initialise three node references: current points to the head node previous points to null next points to null Remember to point the tail to the head before we begin: tail = head; Now, iterate over the nodes […]

XMPP Progress

The XMPP Component framework is coming on nicely. It can connect and send/receive messages: Using C# again is a joy. I absolutely love the dynamic capabilities. For example, in this factory method, Ping is dynamically added – it is not a property: Which produces the following XML: Eventually Ping will be its own subpacket, but […]

C# Null! Tip

C# 8.0 introduced non-nullable reference types. I use them because it is considered best practice. I first encountered them in Kotlin. But I’m not a huge fan because they: have a cascading effect on interfaces and code are often not very helpful Monkey Business On the first problem, there are cases where things might be […]

Enums and Literals

One of the things I love about C# is reflection. Because of assemblies and metadata, and an excellent supporting framework, it is very easy to take advantage of this paradigm. This week I threw myself into building an XMPP component framework from scratch. The first objective is to get the plumbing and architecture in place. […]

Concise C# Property Name

When constructing XML elements, it’s nice to have a concise API. One of the features I’m implementing is the ability to easily move up to a parent element. There’s no cascade operator in C#, like you see in Dart. Whilst exploring options, I found this works: Example usage: I thought that was interesting – albeit […]

Result or no Result

Recently I spent a couple of hours building a few classes to support some functional programming constructs in C#. At the end of the experiment, doubts have me backing out mostly. In certain use cases, the new constructs are a nice fit, but they can easily be overused. And their usage has a cascading effect […]

String Iteration in Dart

I’ve just begun my deep dive into Dart. It’s a very nice language, but the string iteration had me scratching my head for a while. I still don’t know if I am doing it the best way to be honest. In most languages the string class will offer a way to iterate over characters. For […]