I doubt that it helps a whole lot - especially if you let the producer
batch messages in a single request (default).
You can use the SyncProducer or SimpleConsumer class - which provide a
send(<request>) API that can accept a topic metadata request and
returns a topic metadata response.