title: What Java library can buffer incoming data in memory and later write to a destination?
body: <p>I'm looking for a Java Library to help buffer objects in memory before writing them out to a destination.</p>
  
  <p>Example: pull records from a messaging queue and keep them in memory until total records size is equal to 100MB or 15 minutes have passed. Once the threshold is met, perform an operation on these records such as writing them to file OR making API calls to upload data to an AWS S3 bucket.</p>
  
  <p>Such functionality is nearly identical to AWS Firehose (assuming you want to write to an S3 bucket). Unfortunately I'm not able to use AWS and looking for alternatives. It doesn't sound too difficult to implement a custom solution, but I'm trying to avoid re-inventing the wheel if possible.</p>