This PR fixes the issue caused by the Ruby change https://bugs.ruby-lang.org/issues/16150, which made boolean, module name & nil.to_s values frozen by default, making this plugin unable to process Kafka "tombstone" records (a.k.a. a record with a null value).
Using the main branch code, it should terminate the pipeline and log an error similar to:
Exception in thread "kafka-input-worker-logstash-0" org.jruby.exceptions.FrozenError: (FrozenError) can't modify frozen String
at org.jruby.RubyString.force_encoding(org/jruby/RubyString.java:6667)
at org.jruby.RubyString.force_encoding(org/jruby/RubyString.java:6663)
The error should not happen using the fixed version.
This PR fixes the issue caused by the Ruby change https://bugs.ruby-lang.org/issues/16150, which made
boolean
, module name &nil
.to_s
values frozen by default, making this plugin unable to process Kafka "tombstone" records (a.k.a. a record with anull
value).How to test it locally?
1 - Set up the Kafka test environment:
2 - Run the following pipeline config:
3 - Produce a message with a null content:
Using the
main
branch code, it should terminate the pipeline and log an error similar to:The error should not happen using the fixed version.
Closes: https://github.com/logstash-plugins/logstash-integration-kafka/issues/155