Calls the close method on KafkaProducer initialized for the Vuser and uninitializes it.

public static void closeProducer()

public static void closeProducer(Duration timeout)


timeoutMaximum duration to wait for incomplete requests to finish

Return values

This function does not return any values.

General information

This function closes the current producer either immediately or after the duration of the timeout (to allow time to finish incomplete requests). The Vuser cannot use the KakfaProducer instance after this function is called.

To ensure that the KafkaProducer is not needed after this function call, it is recommended to call the function in the end method of the Vuser script. For details, see Manually create and edit a Kafka script in the VuGen help center.