1

I have this property in a class:

private final List<KafkaInterface<EventWhateverDTO>> producers;

Code of interface:

public interface KafkaInterface<T> {
  void produceEvent(Map<String, String> headers, T event);
  void produceEvent(String topic, Map<String, String> headers, T event);
  default List<String> getActions() {
    return Collections.emptyList();
  }
  default Class<T> getEvetTypeClass() {
    return null;
  }
}

and the class

import org.apache.avro.message.SchemaStore;
import org.apache.avro.specific.AvroGenerated;
import org.apache.avro.specific.SpecificData;
import org.apache.avro.specific.SpecificRecord;
import org.apache.avro.specific.SpecificRecordBase;
import org.apache.avro.specific.SpecificRecordBuilderBase;

@AvroGenerated
public class EventWhateverDTO extends SpecificRecordBase implements SpecificRecord {

...

}

I'm using:

    log.info(String.format("producers: %s.", producers));

What would be the suitable way to print the list?

2
  • 1
    What information do you seek as an output? Is it the topic name, headers, etc? What is not working currently or is there any error of sort? Commented Jul 30, 2024 at 2:48
  • 1
    Why do you think that what you’re already using is not suitable? Commented Jul 31, 2024 at 14:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.