Metadata classes do not implement toString #2224
-
I tried logging the metadata of a message and noticed that the I tried working around to no toString on the @Incoming("some-channel")
public CompletionStage<Void> process(final @NotNull Message<byte[]> event) {
final var payload = event.getPayload();
final var list = new ArrayList<>();
event.getMetadata().iterator().forEachRemaining(list::add);
log.info("some-channel: " + Arrays.toString(payload) + " " + list);
return event.ack();
} And got a log like this My Question is it intended that logging Metadata is difficult? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Metadata is just a container. The contained object may not have an understandable For example, in your case it would produce: [IncomingRabbitMQMetadata, Metadata, LocalContextMetadata] (with the FQCN). |
Beta Was this translation helpful? Give feedback.
Metadata is just a container. The contained object may not have an understandable
toString
.The best we could do is to list the included types - but if you have a metadata with a nice
toString
, it would not be used.For example, in your case it would produce: [IncomingRabbitMQMetadata, Metadata, LocalContextMetadata] (with the FQCN).
So, I'm not sure of its usefulness.