Fetching Active DLQ Records
You can use the /openintegration/v1.0/dlq/messages endpoint to fetch
active DLQ records.
Request:
- Method:
GET - Endpoint:
https://<OI Host>:<OI Port>/openintegration/v1.0/dlq/messages - Description:
This API fetches active DLQ records. - Supported query parameters:
-
dlqTopic:Specifies the DLQ Kafka topic to read records from.sourceTopic:Used to filter DLQ records by the original source topic.Limit:Specifies the maximum number of DLQ records to return in the response. For example, iflimitis set to3, the response returns up to three records.Cursor:Fetches the next page of DLQ records. Use thenextCursorvalue from the previous response as thecursorvalue in the next request.
Response:
- DLQ messages envelope: The
/dlq/messagesresponse contains envelope fields that describe the page of DLQ records returned by the API. Each DLQ envelope can include the following fields:Field Description dlqTopicDLQ Kafka topic that was read. If the request does not pass dlqTopic, EPS resolves the configured DLQ topic when possible.sourceTopicSource topic filter used for the request. An empty value means no source topic filter is used. limitPage size used by the response after validation. maxLimitServer-side maximum allowed limit from DLQMessagesMaxLimit. Requests above this value return HTTP400.countNumber of records returned in this page after filtering deleted records and sourceTopic.hasMoreIndicates whether another page is available for the same snapshot. nextCursorOpaque cursor to pass as the cursorquery parameter on the next/dlq/messagescall. Do not parse or modify this value. An emptynextCursorwithhasMore=falsemeans the current snapshot has been fully read.The cursor captures DLQ end offsets at the start of the first page. This prevents a reader from continuously following newly written DLQ records while other consumers are still writing to the DLQ topic. New DLQ records written after the first page can be returned by a later fresh read without a cursor.
- DLQ records: Each DLQ record can include the following fields:
Field Description dlqRecordIdStable identifier used for delete. Current format: dlqTopic|consumerGroup|sourceTopic|sourcePartition|sourceOffset.dlqVersionDLQ payload schema version. Current value: 1.0.topic,partition,offsetKafka coordinates of the DLQ topic record. dlqPartition,dlqOffsetExplicit aliases for the DLQ record partition and offset. These values are the same as partitionandoffsetin the current REST output.sourceTopic,sourcePartition,sourceOffset,sourceTimestampOriginal failed source record coordinates and source Kafka timestamp. keyKafka key of the DLQ topic record. EPS uses the original key when present. Otherwise, it uses dlqRecordId.dataPayload shown for the failed record. For new DLQ records, this is normally the original source value. originalKey,originalValue,originalHeadersOriginal Kafka key, value, and headers captured in the DLQ payload. originalHeaderscan be an empty array when the source record has no headers.failedAtEpoch-millisecond timestamp when EPS built the DLQ payload. failure,failureCategoryHigh-level classification, such as retriable or non-retriable. failureTypeMore specific failure code, such as OM_EXCEPTION,QUEUE_ERROR,BAD_JSON, orUNKNOWN_ERROR.failureReasonDetailed processing failure text used for diagnostics. exception,exceptionMessageException detail when available. These values are usually the same in the current REST output. attemptsNumber of processing attempts in the final processing window before the record was written to DLQ.
200: Returns a page envelope with records.400: Thelimitorcursorvalue is invalid.401: The request is unauthenticated.503: The state cache is initializing.500: An unexpected runtime failure occurred.
Examples:
- Sample
Request:
GET https://<OI Host>:<OI Port>/openintegration/v1.0/dlq/messages?dlqTopic=testevent1-consumer1- dlq&sourceTopic=testevent1&limit=3Response:
{ "dlqTopic": "testevent1-consumer1-dlq", "sourceTopic": "testevent1", "limit": 3, "maxLimit": 500, "count": 3, "hasMore": true, "nextCursor": "eyJkbHFUb3BpYyI6InRlc3RldmVudDEtY29uc3VtZXIxLWRscSIsIm9mZnNldHMiOnsiMCI6IjMiLCIxIjoiMCIsIjIiOiIwIn0sImVuZE9mZnNldHMiOnsiMCI6IjUiLCIxIjoiMCIsIjIiOiIxMCJ9fQ", "records": [ { "dlqRecordId": "testevent1-consumer1-dlq|consumer6|testevent1|1|0", "dlqVersion": "1.0", "dlqTopic": "testevent1-consumer1-dlq", "consumerGroup": "consumer6", "topic": "testevent1-consumer1-dlq" } ] }Use the nextCursor value as the cursor query parameter to fetch the next page of records.
- Sample
Request:
GET https://<OI Host>:<OI POrt>/openintegration/v1.0/dlq/messages?dlqTopic=testevent1-consumer1- dlq&sourceTopic=testevent1&limit=10&cursor=eyJkbHFUb3BpYyI6InRlc3RldmVudDEtY29uc3VtZXIxLWRscSIsIm9mZnNldHMiOnsiMCI6IjUiLCIxIjoiMCIsIjIiOiI4In0sImVuZE9mZnNldHMiOnsiMCI6IjUiLCIxIjoiMCIsIjIiOiIxMCJ9fQResponse:
{ "dlqTopic": "testevent1-consumer1-dlq", "sourceTopic": "testevent1", "limit": 10, "maxLimit": 500, "count": 2, "hasMore": false, "nextCursor": "", "records": [ { "dlqRecordId": "testevent1-consumer1-dlq|consumer6|testevent1|2|6", "dlqVersion": "1.0", "dlqTopic": "testevent1-consumer1-dlq", "consumerGroup": "consumer6", "topic": "testevent1-consumer1-dlq", ....... }, { "dlqRecordId": "testevent1-consumer1-dlq|consumer6|testevent1|0|6", "dlqVersion": "1.0", "dlqTopic": "testevent1-consumer1-dlq", "consumerGroup": "consumer6", "topic": "testevent1-consumer1-dlq", ...... } ] }In this example, the request uses the cursor from the previous response. Although the request sets
limitto10, only two records remain, so the response returns two records. Because no more records are available,hasMoreisfalseandnextCursoris empty.