Is there a way to control how/when a batch will close when using the Java SDK? It seems that the default gateway connector does not support this. I am running the following