InMemoryTopics
Topics in memory, a TopicProducer and a PartitionedSource at once, for tests and samples, as the other in-memory backends: a topic is created, or created with partitions partitions when it is first written or read; a message goes to the partition it names, else to the one its key's hash picks (partitionOf), and every partition keeps what it was sent, from offset 0, up to its last retention messages, until retain drops its oldest messages as a broker's retention would.
failure, when set, makes every send throw it without writing anything, as a broker that does not acknowledge.
As a TopicAdmin, it describes the topics created so far and creates the ones asked for; grow adds partitions to a topic, as an operator does to a Kafka topic.
Properties
The most messages a partition keeps, at least one (DEFAULT_RETENTION unless set): once a write takes a partition past it, the partition drops its oldest messages, as a broker's size retention drops them, and the topic says so once, the first time. A read from an offset no longer kept starts at the oldest one kept, the offset gap a reader handles as it does on a broker (PartitionedSource.read). So the topics stay bounded however long the node runs: they cannot keep a message until its readers have read it, since a source knows no reader's position, which each keeps in its own checkpoint.