Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kinesis Stream Metadata to firehose event #188

Merged
merged 3 commits into from
May 10, 2019

Conversation

bhavikkumar
Copy link
Contributor

@bhavikkumar bhavikkumar commented May 9, 2019

Add sourceKinesisStreamArn and KinesisRecordMetadata to event structs .

Attempting to do a put record API call on a Firehose Delivery stream which has a Kinesis Stream as the source will result in the error This operation is not permitted on KinesisStreamAsSource delivery stream type.. Therefore it is useful to have the sourceKinesisStreamArn so put record API calls can be made by Lambda functions to the source Kinesis Stream.

In addition the Kinesis Record Metadata has been added to the event so the same partition key can be used if the data needs to be reingest to the source Kinesis stream.

This is particularly useful when attempting to reingest data due to hitting the 6MB size limit of the response payload.

@codecov-io
Copy link

codecov-io commented May 9, 2019

Codecov Report

Merging #188 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #188   +/-   ##
======================================
  Coverage    77.2%   77.2%           
======================================
  Files          18      18           
  Lines         636     636           
======================================
  Hits          491     491           
  Misses        104     104           
  Partials       41      41

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 18bf34b...4ff0e7b. Read the comment docs.

@bhavikkumar bhavikkumar changed the title Add source kinesis stream arn to firehose event Add Kinesis Stream Metadata to firehose event May 9, 2019
ShardID string `json:"shardId"`
PartitionKey string `json:"partitionKey"`
SequenceNumber string `json:"sequenceNumber"`
ApproximateArrivalTimestamp MilliSecondsEpochTime `json:"approximateArrivalTimestamp"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI failed (https://travis-ci.org/aws/aws-lambda-go/builds/530382884). Need to check if the type needs to be string, or if the test data is wrong.

...
--- FAIL: TestSampleTransformation (0.00s)
    firehose_test.go:50: could not unmarshal event. details: json: cannot unmarshal string into Go struct field KinesisFirehoseRecordMetadata.approximateArrivalTimestamp of type int64
...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found a reference internally and a sample event in the console - I will update the test data and merge

updated type to match sample in Lambda console
@bmoffatt bmoffatt merged commit 43eb3b9 into aws:master May 10, 2019
@bmoffatt
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants