Amar3tto commented on code in PR #31618:
URL: https://github.com/apache/beam/pull/31618#discussion_r1643996264
##########
sdks/java/io/rabbitmq/src/main/java/org/apache/beam/sdk/io/rabbitmq/RabbitMqMessage.java:
##########
@@ -78,30 +80,37 @@ private static Map<String, Object>
serializableHeaders(Map<String, Object> heade
if (headers != null) {
for (Map.Entry<String, Object> h : headers.entrySet()) {
Object value = h.getValue();
- if (!(value instanceof Serializable)) {
- try {
- if (value instanceof LongString) {
- LongString longString = (LongString) value;
- byte[] bytes = longString.getBytes();
- String s = new String(bytes, StandardCharsets.UTF_8);
- value = s;
- } else {
- throw new RuntimeException(String.format("no transformation
defined for %s", value));
- }
- } catch (Throwable t) {
- throw new UnsupportedOperationException(
- String.format(
- "can't make unserializable value %s a serializable value
(which is mandatory for Apache Beam dataflow implementation)",
- value),
- t);
- }
+ if (value instanceof List<?>) {
Review Comment:
Added `RabbitMqMessageTest`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]