code: function discardRejectedMessageToDMQ(rejectedMessage, batch, toDMQPutRequest, context) {
    if (!rejectedMessage) {
      return Promise.resolve(undefined);
    }
  
    const msgState = batch && batch.states.get(rejectedMessage);
    const id = msgState && msgState.id;
  
    if (!batch || !batch.isKeyValid()) {
      const error = new Error(`Missing valid batch key (${JSON.stringify(batch && batch.key)}) needed to discard rejected message (${id})`);
      context.error(error);
      return Promise.reject(error);
    }
  
    const kinesis = getKinesis(context);
  
    // Get the stage-qualified version of the DRQ stream name
    const unqualifiedDeadMessageQueueName = context.streamProcessing.deadMessageQueueName;
    const deadMessageQueueName = stages.toStageQualifiedStreamName(unqualifiedDeadMessageQueueName, context.stage, context);
  
    // Discard the rejected message to the DMQ
    const request = toDMQPutRequest(rejectedMessage, batch, deadMessageQueueName, context);
    return kinesis.putRecord(request).promise().then(
      result => {
        context.debug(`Discarded rejected message (${id}) to DMQ (${deadMessageQueueName})`);
        return result;
      })
      .catch(err => {
        context.error(`Failed to discard rejected message (${id}) to DMQ (${deadMessageQueueName})`, err);
        throw err;
      });
  }
docs: Routes the given rejected message to the DMQ (i.e. Dead Message Queue).
  Default implementation of a {@link DiscardRejectedMessage} function.
  @param {Message} rejectedMessage - the rejected message to discard
  @param {Batch} batch - the batch being processed
  @param {function(rejectedMessage: Message, batch: Batch, deadMessageQueueName: string, context: StreamConsumerContext): KinesisPutRecordRequest} toDMQPutRequest - the function to use to convert the dead message into a Kinesis PutRecord request
  @param {StreamProcessing} context the context to use
  @return {Promise}