code: public StreamParameters withBatchFlushTimeout(int batchFlushTimeout) throws IllegalArgumentException {
          if (streamTimeout != null && streamTimeout < batchFlushTimeout){
              throw new IllegalArgumentException("stream_timeout is lower than batch_flush_timeout.");
          }
  
          return new StreamParameters(batchLimit, streamLimit, batchFlushTimeout, streamTimeout, streamKeepAliveLimit, maxUncommittedEvents, commitTimeout);
      }
docs: Maximum time in seconds to wait for the flushing of each chunk (per partition).
  
  @param batchFlushTimeout
  If the amount of buffered Events reaches batch_limit before this batch_flush_timeout is reached,
  the messages are immediately flushed to the client and batch flush timer is reset.
  If 0 or undefined, will assume 30 seconds.
  
  @throws IllegalArgumentException