Streaming data to an HTTP endpoint with Amazon Kinesis Data Firehose

0

Hi All, Trying to implement "Streaming data to an HTTP endpoint with Amazon Kinesis Data Firehose" using AWS Big Data blog https://aws.amazon.com/blogs/big-data/stream-data-to-an-http-endpoint-with-amazon-kinesis-data-firehose/. Blog does not tell about "REST API in Amazon API Gateway" Mapping template - for Integration Request and Integration Response is configured. I am getting error HTTPEndpoint "missing requestId". How to set Integration Response & Method Response in API Gateway to work. Any help is much appreciated.

2개 답변
1

There are some good tutorials that can help you understand how to configure API Gateway - https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-rest-tutorials.html

profile pictureAWS
전문가
답변함 2년 전
profile picture
전문가
검토됨 한 달 전
  • @UdAWS - If my answer has helped you understand API Gateway better, can I request you to please accept my answer. Thanks

0

Kinesis DF expects a specific response format - see https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html for details. The same responseId from the request sent to a HTTP destination must exist as well in the response. If you can not influence HTTP destination so it replies with the expected format you can use API Gateway Rest API with the integration type of HTTP. There you can define VTL templates to map responses from the target. The only way I know to remember requestId between the request and the response is to add an integration request template

#set($context.requestOverride.header.request-id = $util.parseJson($input.body).requestId)
$input.json('$')

and then in the integration response template:

#set($requestId = $context.requestOverride.header.request-id)
{
  "requestId": "$requestId",
  "timestamp": $context.requestTimeEpoch
}
답변함 5달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠