If a target is configured to store bad records in a dead-letter queue (DLQ), you can retrieve the bad records through the API. By default, the API returns 50 dead-letter records per page. Only an owner or administrator can perform this function.
The response header shows the amount of DLQ records the request returns. The response body contains the DLQ records.
Request to Retrieve First Page of Records
GET https://CLUSTER.DOMAIN/listener/appservices/targets/{target_id}/dead-letter-queue/records HTTP/1.1
Example Response Header
The following example response header shows 53 DLQ records, where:
- x-length indicates the total number of DLQ records on the current page
- x-page indicates the current page
- x-total indicates the total number of DLQ records currently in Listener
- x-total-pages indicates the total number of pages that can fit all the DLQ records
access-control-allow-headers:Content-Type, Accept, Authorization access-control-allow-methods:GET, PUT, POST, PATCH, DELETE access-control-allow-origin:* access-control-expose-headers:X-Page, X-Pages, X-Per-Page, X-Total, Links content-encoding:gzip content-type:application/json date:Fri, 22 Sep 2017 19:14:22 GMT server:nginx/1.13.3 status:200 strict-transport-security:max-age=15724800; includeSubDomains; x-length:50 x-page:1 x-total:53 x-total-pages:2
Example Response Body
HTTP/1.1 200 OK
[ { "error_reason" : "[Teradata Database] [TeraJDBC 15.10.00.22] [Error 7548] [SQLState HY000] Invalid JSON data: Expected something like whitespace or '}' or ']' or ',' between '\"' and the end of the string. Make sure data was not truncated.", "uuid" : "49a13591-f7bb-4bb2-ab29-68f9a50bcbe8", "date" : "2017-06-05 14:58:13", "data" : "{\"name\":\"John Smith\", \"supername\":\"jsmith\" ", "error_code" : -7548 }, { "uuid" : "adb47637-17c9-43c8-b7e3-5ed5189477f9", "date" : "2017-06-06 10:30:11", "error_code" : -7548, "error_reason" : "[Teradata Database] [TeraJDBC 15.10.00.22] [Error 7548] [SQLState HY000] Invalid JSON data: Expected something like whitespace or '}' or ']' or ',' between '\"' and '\"' at character position 46. Make sure data was not truncated.", "data" : "{\"name\":\"Jane Landers\", \"supername\":\"jlanders\" \"manager1\" " } ]
Request to Retrieve Second Page of Records
If you retrieve more than 50 records, enter the following request to retrieve the second page.
GET https://CLUSTER.DOMAIN/listener/appservices/targets/{target_id}/dead-letter-queue/records?page=2 HTTP/1.1
Response Codes
Code | Description |
---|---|
200 | Successfully retrieved record. |
403 | User does not have permission. |