Offset Explorer supports custom plugins written in Java. Plugins allow you to view messages that are not natively understood by Offset Explorer in a format that suits your needs. For example, you can write a decorator for Thrift messages that shows the contents of the Thrift objects in a suitable format.
An example plugin is included in the plugins/example folder in your Offset Explorer installation directory.
You need to create a class that implements the com.offsetexplorer.external.ICustomMessageDecorator2 interface. The interface is located in the src directory of the provided example plugin, and it has two methods that you need to implement:
This method should return a name that will be shown in Offset Explorer's topic configuration screen, where you can pick the content type for the selected topic.
This method performs the conversion from a byte array to a String that contains the desired output. The String may contain newlines. You should not throw any exceptions from this method; instead, catch all throwables in a try/catch block in your implementation. The reserved argument is currently unused, but it may contain data in future releases.
Note that the old ICustomMessageDecorator interface is deprecated but still supported. It does not provide support for message headers.
You must compile your source code using a Java 21-compatible compiler.
You must put your compiled classes and any dependencies you might have (for example, Thrift libraries) into a SINGLE jar. Do not include any jars that are already in the lib directory of Offset Explorer, especially any Apache Kafka jars.
Once you have compiled and packaged your jar, copy it to the plugins folder in the Offset Explorer installation directory. Restart Offset Explorer and navigate to the topic on which you want to use the decorator. In the Content Types drop-downs, you should see the name of your decorator. Select it and click Update. After that, the messages and keys will be decorated using your custom decorator.