{"record":{"id":"5315cf68a22699ab","repo":"apache/beam","slug":"no-transformation-defined-for-s","errorCode":null,"errorMessage":"No transformation defined for %s","messagePattern":"No transformation defined for (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/rabbitmq/src/main/java/org/apache/beam/sdk/io/rabbitmq/RabbitMqMessage.java","lineNumber":106,"sourceCode":"              ((List<?>) value)\n                  .stream().map(RabbitMqMessage::getTransformedValue).collect(Collectors.toList());\n        } else if (!(value instanceof Serializable)) {\n          value = getTransformedValue(value);\n        }\n        returned.put(h.getKey(), value);\n      }\n    }\n    return returned;\n  }\n\n  private static Object getTransformedValue(Object value) {\n    try {\n      if (value instanceof LongString) {\n        LongString longString = (LongString) value;\n        byte[] bytes = longString.getBytes();\n        value = new String(bytes, StandardCharsets.UTF_8);\n      } else {\n        throw new RuntimeException(String.format(\"No transformation defined for %s\", value));\n      }\n    } catch (Throwable t) {\n      throw new UnsupportedOperationException(\n          String.format(\n              \"Can't make unserializable value %s a serializable value (which is mandatory for Apache Beam dataflow implementation)\",\n              value),\n          t);\n    }\n    return value;\n  }\n\n  private final @Nullable String routingKey;\n  private final byte[] body;\n  private final String contentType;\n  private final String contentEncoding;\n  private final Map<String, Object> headers;\n  private final Integer deliveryMode;\n  private final Integer priority;","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/rabbitmq/src/main/java/org/apache/beam/sdk/io/rabbitmq/RabbitMqMessage.java#L88-L124","documentation":"RabbitMqMessage.getTransformedValue converts RabbitMQ header values to serializable forms; only LongString is supported. Any other header value type triggers a RuntimeException 'No transformation defined for %s', which is then wrapped (see error 2446) into an UnsupportedOperationException.","triggerScenarios":"A message published with headers whose values are not LongString (e.g. Integer, Boolean, Date, byte[], Map) and the reader calls serializableHeaders/getTransformedValue.","commonSituations":"Producers using AMQP field tables with typed values; framework-injected headers with numeric/boolean values; header encoding differences across client libraries.","solutions":["Change the producer to publish header values as LongString (e.g. new LongStringHelper.LongString(str.getBytes(UTF_8))).","Filter out non-string headers before the Beam reader consumes them.","Extend RabbitMqMessage to handle additional AMQP types (Integer, Boolean, octet) and convert them to serializable values.","Move complex metadata into the message body instead of headers."],"exampleFix":"// before\nchannel.basicPublish(\"\", queue, propsWith(\"count\", 42), body); // Integer header\n// after\nchannel.basicPublish(\"\", queue, propsWith(\"count\", new LongStringHelper.LongString(\"42\".getBytes(UTF_8))), body);","handlingStrategy":"type-guard","validationCode":"// Check header value type before consuming\nObject v = headers.get(\"myHeader\");\nif (!(v instanceof LongString)) { throw new IllegalArgumentException(\"header must be LongString, got \" + v.getClass()); }","typeGuard":"boolean isSerializableHeader(Object v) { return v instanceof LongString; }","tryCatchPattern":"try { msg.getTransformedValue(key); } catch (RuntimeException | UnsupportedOperationException e) { log.warn(\"unsupported header type for key\", e); /* skip header */ }","preventionTips":["Standardize producers to send header values as strings (LongString).","Strip custom typed headers at the broker or a proxy before Beam consumes.","Add a unit test round-tripping every header type your producers emit."],"tags":["rabbitmq","serialization","headers","apache-beam"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}