Because the consumer set headers with kafka topic and partition from the consumer, then these will override the endpoint configured on the producer, eg
will end up going back to foo.
You can remove the headers to make it work
But maybe we should have an option on the producer that takes the endpoint value always, and you need to turn the option on to allow header overrides.
Another option is to detect that its the same topic to avoid sending it back to itself.