Fix DSM queue names with Kafka Connect IBM MQ connectors by johannbotha · Pull Request #10318 · DataDog/dd-trace-java

@johannbotha @claude

When using Kafka Connect with IBM MQ connectors, DSM was reporting
incorrect queue names with schema-derived suffixes like _messagebody_0.
This occurred because Kafka Connect schema converters add index suffixes
to field names for union/optional types.

This fix sanitizes queue/topic names to remove these suffixes:
- _messagebody_N
- _text_N
- _bytes_N
- _map_N
- _value_N

Fixes Zendesk ticket #2429181

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

PerfectSlayer

@johannbotha @claude

…mance

Address review feedback to avoid Pattern/Matcher usage for performance reasons.
Use lastIndexOf() and regionMatches() instead of regex to strip Kafka Connect
schema-derived suffixes from queue names.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

PerfectSlayer

AlexeyKuznetsov-DD

@johannbotha @claude

Group len==5 cases together (bytes, value) before len==3 case (map).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

@johannbotha johannbotha deleted the jj.botha/fix-dsm-ibmmq-kafka-connect-queue-name branch

January 13, 2026 05:20