receive_queue_records
¶
receive_queue_records(
queue_arn: QueueARN,
*,
config_overrides: Optional[KinesisClientConfig] = None,
limit: Optional[ReceiveQueueRecordsInputLimit] = None,
wait_time_seconds: Optional[ReceiveQueueRecordsWaitTimeSeconds] = None,
visibility_timeout_seconds: Optional[VisibilityTimeoutSeconds] = None,
) -> ReceiveQueueRecordsOutput
Receives up to 10 records from the specified queue. Each record is returned with a receipt handle, which is the identifier you use to acknowledge the record or change its visibility.
A record returned by ReceiveQueueRecords becomes in flight: it is not visible to any consumer instance for the duration of its visibility timeout, so subsequent receive requests do not return it while your queue consumer processes it. Acknowledge the record with AcknowledgeQueueRecords when you finish processing it. A record that is not acknowledged before its visibility timeout expires becomes visible in the queue again and can be received by any consumer instance.
Use WaitTimeSeconds to control how long the call waits for a record to become visible before returning. If a record becomes visible sooner, the call returns sooner. If the wait time expires and no records are visible, the call returns an empty list of records.
Records are not necessarily received in the order they were written to the data stream.
A queue delivers records while it is in the ACTIVE state.
On rare occasions, a queue can deliver a record more than once. Design your queue consumer to be idempotent, so that processing the same record more than once is safe.
Parameters:
-
queue_arn(QueueARN) –The ARN of the queue to receive records from.
-
limit(Optional[ReceiveQueueRecordsInputLimit], default:None) –The maximum number of records to return. The queue never returns more records than this value, and might return fewer. The default is 10.
-
wait_time_seconds(Optional[ReceiveQueueRecordsWaitTimeSeconds], default:None) –The duration, in seconds, that the call waits for a record to become visible before returning. The default is 9.
-
visibility_timeout_seconds(Optional[VisibilityTimeoutSeconds], default:None) –The duration, in seconds, that the records returned by this request are in flight and not visible to any consumer instance. If you do not specify this value, the queue's visibility timeout is used.
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.
-
KMSAccessDeniedException–The ciphertext references a key that doesn't exist or that you don't have access to.
-
KMSDisabledException–The request was rejected because the specified KMS key isn't enabled.
-
KMSInvalidStateException–The request was rejected because the state of the specified resource isn't valid for this request. For more information, see How Key State Affects Use of a Customer Master Key in the Amazon Web Services Key Management Service Developer Guide.
-
KMSNotFoundException–The request was rejected because the specified entity or resource can't be found.
-
KMSOptInRequired–The Amazon Web Services access key ID needs a subscription for the service.
-
KMSThrottlingException–The request was denied due to request throttling. For more information about throttling, see Limits in the Amazon Web Services Key Management Service Developer Guide.
-
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/kinesis.py
2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 | |