awslabs / kinesis-aggregation

AWS libraries/modules for working with Kinesis aggregated record data
Apache License 2.0
376 stars 154 forks source link

aws-kinesis-agg nodejs 18 + support #177

Open melissa-dev opened 1 year ago

melissa-dev commented 1 year ago

I'm currently using aws-kinesis-agg@4.2.6 for the implementation of a consumer that receives Kinesis event inputs and processes the messages that it contains which is running under Nodejs 16.

By working on the nodejs update at least on Nodejs 18 (regarding also the different support of Nodejs version for the lambda runtime) we are facing the following issue :

npm ERR! engine Unsupported engine npm ERR! engine Not compatible with your version of node/npm: aws-kinesis-agg@4.2.6 npm ERR! notsup Not compatible with your version of node/npm: aws-kinesis-agg@4.2.6 npm ERR! notsup Required: {"npm":"^8.1.0"} npm ERR! notsup Actual: {"npm":"9.5.1","node":"v18.16.0"}

It seems that no update was pushed to the library until one year. Is it still supported or a migration around another usage / library is recommended ? Thanks in advance for your answers.

IanMeyers commented 1 year ago

Hello - sorry to see you were having this issue. I've just pushed 4.2.8 with updated engines support. Tests look like node 18 is fine:

$$$f:node meyersi$ node --version
v18.12.1
$$$f:node meyersi$ npm --version
9.8.1
$$$f:node meyersi$ export NODE_ENV=test && mocha --recursive --timeout 4000

  #deaggregate-aggregate
    ✔ deaggregates aggregated record

  #aggregate
    ✔ aggregate is a function
    ✔ aggregate call afterPutAggregatedRecords when no encoded record are processed
    ✔ aggregate should raise error when record is over 1Mo
    ✔ aggregate call encodedRecordHandler on each encoded record (73ms)
    ✔ aggregate encoded records with max size of 1Mo (55ms)
    ✔ aggregate call afterPutAggregatedRecords when on each encoded record are processed (621ms)

  #common
    ✔ Current KplVersion is 0.9.0
    ✔ Current magicNumber is f3899ac2
    ✔ magic buffer represent f3899ac2
    ✔ loadBuilder load object which will hold the protocol buffer model
    ✔ AggregatedRecord is an object which will hold the protocol buffer model
    ✔ randomPartitionKey generate random string
    ✔ v3FormatToV2Format should return object with property name converted to first letter lowercase
    ✔ v2FormatToV3Format should return object with property name converted to first letter uppercase

  #deaggregate
    ✔ deaggregate is a function

  #aggregate optional ExplicitHashKey
    ✔ aggregate without ExplicitHashKey should not add an ExplicitHashKey
    ✔ aggregate with ExplicitHashKey should have an ExplicitHashKey

  18 passing (784ms)