Skip to content

restore_dead_letter_queue_records async

restore_dead_letter_queue_records(
    queue_arn: QueueARN,
    entries: RestoreDeadLetterQueueRecordsRequestEntryList,
    *,
    config_overrides: Optional[AsyncKinesisClientConfig] = None,
) -> RestoreDeadLetterQueueRecordsOutput

Restores up to 10 dead-letter records in the specified queue. Restoring a record clears its dead-letter state and resets its receive count, so ReceiveQueueRecords can return it again, up to MaxReceiveCount times before it becomes a dead-letter record again. The result for each entry is reported individually in the response.

Restore records after you have corrected the condition that prevented your queue consumer from processing them.

Because the request can result in a combination of successful and unsuccessful entries, check the Failed list even when the call returns an HTTP status code of 200.

Parameters:

Raises:

  • AccessDeniedException –

    Specifies that you do not have the permissions required to perform this operation.

  • InternalFailureException –

    The processing of the request failed because of an unknown error, exception, or failure.

  • InvalidArgumentException –

    A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.

  • ResourceNotFoundException –

    The requested resource could not be found. The stream might not be specified correctly.

  • ThrottlingException –

    The request was denied because the request rate is too high. Reduce the frequency of your requests, and retry them with exponential backoff.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_kinesis/_services/async_kinesis.py
async def restore_dead_letter_queue_records(
    self,
    queue_arn: "capo_kinesis.types.queue_arn.QueueARN",
    entries: "capo_kinesis.types.restore_dead_letter_queue_records_request_entry_list.RestoreDeadLetterQueueRecordsRequestEntryList",
    *,
    config_overrides: Optional[AsyncKinesisClientConfig] = None,
) -> "capo_kinesis.types.restore_dead_letter_queue_records_output.RestoreDeadLetterQueueRecordsOutput":
    """<p>Restores up to 10 dead-letter records in the specified queue. Restoring a record clears its dead-letter state and resets its receive count, so <a>ReceiveQueueRecords</a> can return it again, up to <code>MaxReceiveCount</code> times before it becomes a dead-letter record again. The result for each entry is reported individually in the response.</p> <p>Restore records after you have corrected the condition that prevented your queue consumer from processing them.</p> <p>Because the request can result in a combination of successful and unsuccessful entries, check the <code>Failed</code> list even when the call returns an HTTP status code of <code>200</code>.</p>

    Args:
        queue_arn: <p>The ARN of the queue whose dead-letter records are restored.</p>
        entries: <p>The dead-letter records to restore, identified by their receipt handles.</p>

    Raises:
        capo_kinesis.errors.access_denied_exception.AccessDeniedException: <p>Specifies that you do not have the permissions required to perform this operation.</p>
        capo_kinesis.errors.internal_failure_exception.InternalFailureException: <p>The processing of the request failed because of an unknown error, exception, or failure.</p>
        capo_kinesis.errors.invalid_argument_exception.InvalidArgumentException: <p>A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.</p>
        capo_kinesis.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found. The stream might not be specified correctly.</p>
        capo_kinesis.errors.throttling_exception.ThrottlingException: <p>The request was denied because the request rate is too high. Reduce the frequency of your requests, and retry them with exponential backoff.</p>
        capo_kinesis.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kinesis.types.restore_dead_letter_queue_records_input.RestoreDeadLetterQueueRecordsInput]",
    ) -> AsyncOperationResponse[
        "capo_kinesis.types.restore_dead_letter_queue_records_output.RestoreDeadLetterQueueRecordsOutput"
    ]:
        import capo_kinesis._operations.kinesis_20131202.restore_dead_letter_queue_records

        (
            output,
            http_response,
        ) = await capo_kinesis._operations.kinesis_20131202.restore_dead_letter_queue_records.async_restore_dead_letter_queue_records(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RestoreDeadLetterQueueRecords")
    )
    input_: capo_kinesis.types.restore_dead_letter_queue_records_input.RestoreDeadLetterQueueRecordsInput = {
        "queue_arn": queue_arn,
        "entries": entries,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output