title: Size of SQS messages
body: <p>I'm sending messages to SQS using the AWS-SDK for JavaScript. Each message needs to be 256kb in size tops.</p>
  
  <p>Each message is a JSON object that gets decoded on another service.</p>
  
  <p>Option 1: JSON Object as string: Count length and make sure it's less than  262144?</p>
  
  <pre><code>function* getStuff(rows, someConfig) {
    let totesPayload = 0
    let payload = []
    for (const row of rows) {
     const singleItemInPayload = rowToPayload(row, someConfig)
     if (singleItemInPayload.length + totesPayload &lt; 262144 - (enclosingObjectSize())) {
       payload.push(singleItemInPayload)
       totesPayload += singleItemInPayload.length
     } else {
       yield({ payload })
       payload = []
     }
  }
  </code></pre>
  
  <p>Option 2: Buffer.from(JSON Object as string): Count length of JSON Object and make sure it's less than  262144?</p>
  
  <p>Most of the data is text, so I'm not sure I'm going to get any good help from putting it in a byte array. </p>
  
  <p>Is option 2 necessary? </p>