I think there is a bug in EmbeddedKafka.consumeFromAnEmbeddedTopic(Consumer consumer, String topic)
. It does not wait to be assigned partitions from the embedded topic as is the case with EmbeddedKafka.onsumeFromAllEmbeddedTopics(Consumer consumer).
I created a test, which fails with the current behaviour here.
When a consumer is created with EmbeddedKafka.consumeFromAllEmbeddedTopics(Consumer consumer), all the messages are received.
When a consumer is created with EmbeddedKafka.consumeFromAnEmbeddedTopic(Consumer consumer, String topic), the messages are not all received.
I created a PR here if you agree with this.