What is the Difference between Flush method of the Producer and the MessageTimeoutMs in Config?

Hi I’m new to Confluent Kafka. I’m developing an application which works as a Producer, that produces messages to the topics in Confluent cloud, which will be later consumed by another application.

Now while building the Producer, I could see this configuration MesaageTimeoutMs property (I believe the default is 300000 ms) and there’s a method Flush(), which is polymorphed (one takes TimeSpan as an argument and another takes CancellationToken).

What is the significance of these config and method?
If they impact my application’s performance and impact each other’s functionality, how do they do it?

Say if my, MessageTimeoutMs is configured as 30000 , the Flush method takes 5000 ms as argument,
What is the meaning of this and how they work?