Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ExtractedEventInfo
type_
assignment used to fall back to the header value, but didn't remove it. The result is that the "type" would be found both in the top-leveltype_
variable as well as inheaders["type"]
. Now, the value is popped.KafkaDLQSubscriber
InboundProviderBase
because this is actually a specialized class that has little overlap with the normal subscriber provider class.._get_events_from_dlq()
:.preview()
,.ignore()
, and.process()
.max_records
(int) parameter tells the function how many records to retrieve at most.AIOKafkaConsumer.getmany
withmax_records
and an arbitrary but reasonable timeout (500ms). The purpose of the timeout is to retrieve the records without hanging forever, since we can't know if or how many records will be available to fetch..preview()
:max_records
islimit + skip
limit
(int) andskip
(int). These parameters are for pagination of the preview results.limit
will cap the number of results returned, andskip
tells the function how far forward to start the preview. If there are no events in the topic, or ifskip
is greater than the number of events available, an empty list is returned..ignore()
:run(ignore=True)
process()
:run(ignore=False)
Tests
TEST_DLQ_EVENT
was created because several tests were defining the same test event to publish directly to the DLQ. Adding this allowed for the condensing of the relevant test cases.