Possible (although extremely, very extremely, unlikely) race condition on `messageHeaders`. If `batchSize` threads hit this method concurrently, `messageHeaders` might still be null below.