implementation of streaming json by batch