Commit graph

145 commits

Author SHA1 Message Date
Edward Tsang
63829e7e07 remove double tagging f aws requestID 2018-11-14 10:35:07 -08:00
Edward Tsang
91787fac0e add aws req retry count. move tagging requestId to complete handler. some aws services fill that in at that stage. tag response content length. req throttled. 2018-11-14 10:22:59 -08:00
Edward Tsang
5ff0624a2d add back commented out code 2018-11-12 09:01:16 -08:00
Edward Tsang
a6eaeb2bfa need to add context as first parameter to pass through, fixed tests and readme 2018-11-07 15:45:13 -08:00
Edward Tsang
0528067bbe need to use AWS call ***WithContext to flow the context object from upper layer 2018-11-07 10:29:17 -08:00
Edward Tsang
831efcece3 Merge remote-tracking branch 'origin/master' into opentracing_examples 2018-11-06 15:06:55 -08:00
Edward Tsang
43cf094b27 * instrumented consumer amd producer example with opentracing
* add doc for jaeger and steps for running opentracing examples
* add context appropriate
* add utility for AWS tracing .. Createing tracer/logger etc
2018-11-06 15:03:34 -08:00
Vincent
cb35697903 Write unit tests for Postgres package (#69)
Changes:
* I add postgres_databaseutils_test.go for containing all utilities for mocking the database.
* I put appName as a required parameter passed to the New() since it is needed to form the namespace column name.
* I add GetMaxInterval() since it might be needed by the consumer and the test.
* I move the SQL string package variables directly into the function that need it so we could avoid maintenance nightmare in the future.
2018-10-14 11:23:37 -06:00
Edward Tsang
37fc2cd212 Merge remote-tracking branch 'origin/master' 2018-09-10 12:24:22 -07:00
Vincent
d3b76346f5 Break down the big function and Add tests for Scan (#65) 2018-09-03 09:59:39 -07:00
Harlow Ward
23811ec99a Add test for stopping scan 2018-07-29 10:27:01 -07:00
Harlow Ward
d6ded158bf Refactor the consumer tests
A previous PR from @vincent6767 had nicer mock Kinesis client that
simplified setting up data for the tests.

Mock client pulled from:
https://github.com/harlow/kinesis-consumer/pull/64
2018-07-29 10:13:03 -07:00
Harlow Ward
911282363e Update go dep and prune unused packages 2018-07-28 22:58:40 -07:00
Harlow Ward
fb98fbe244
Remove the client wrapper (#58)
Having an additional Client has added some confusion (https://github.com/harlow/kinesis-consumer/issues/45) on how to provide a
custom kinesis client. Allowing `WithClient` to accept a Kinesis client
it cleans up the interface.

Major changes:

* Remove the Client wrapper; prefer using kinesis client directly
* Change `ScanError` to `ScanStatus` as the return value isn't necessarily an error

Note: these are breaking changes, if you need last stable release please see here: https://github.com/harlow/kinesis-consumer/releases/tag/v0.2.0
2018-07-28 22:53:33 -07:00
Vincent
049445e259 Add unit tests for the GetRecords function (#64)
A closed shard returns the last sequence number and no error. The current implementation leads to an infinite loop if the shard is closed. NextShardIterator checking is enough. That's why I remove the getShardIterator call
2018-07-28 10:36:22 -07:00
Vincent
a1239221d8 Ignore IDE files and fix code based Gometalinter (#63)
- scanError.Error is removed since it is not used.
- session.New() is deprecated, The NewKinesisClient's function signature change so it can
  returns the error from the NewSession().
2018-07-24 20:10:38 -07:00
Emanuel Ramos
cf5d22abff Adding Option func to set maxInterval (#60) 2018-07-13 07:26:21 -07:00
Umur Gedik
9ccee87b62 Add an option to start consuming from latest (#59)
* Add an option to client to start consuming from latest
2018-06-27 20:05:09 -07:00
Emanuel Ramos
b7be26418a Add postgres checkpoint implementation (#55) 2018-06-17 19:27:10 -07:00
Prometheus
739e9e39a5 Make it possible to let user use 3rd party logging library (#56) 2018-06-12 18:07:33 -07:00
Edward Tsang
b04d4a4670 Merge remote-tracking branch 'origin/master' 2018-06-12 12:49:39 -07:00
Prometheus
e6a489c76b Scanerror signals the consumer if we should continue scanning for next record & whether to checkpoint. (#54)
* remove ValidateCheckpoint

* update for checkpoint can not customize retryer

* implement the scan error as in PR 44

* at least log if record processor has error

* mistakenly removed this line

* propage error up. ignore invalid state
2018-06-08 08:40:42 -07:00
Prometheus
b05f5b3ac6 Update readme for checkpoint <EOM> (#53)
* remove ValidateCheckpoint
* update for checkpoint can not customize retryer
2018-06-07 21:10:28 -07:00
Edward Tsang
4c2864ef56 update for checkpoint can not customize retryer 2018-06-05 11:52:12 -07:00
Edward Tsang
cba40aeeb8 Merge remote-tracking branch 'origin/master' 2018-06-05 11:49:51 -07:00
Prometheus
d058203b6e Make what aws error to trigger retry decided by caller (#52)
* remove ValidateCheckpoint
* make retrying on error decided by caller
2018-06-04 20:07:58 -07:00
Prometheus
9a7e102a05 remove ValidateCheckpoint (#51) 2018-06-01 19:34:46 -07:00
Edward Tsang
a800065101 remove ValidateCheckpoint 2018-06-01 18:25:08 -07:00
Prometheus
992cc42419 DDB uses default AWS config settings to ping table; won't work with WithDyanmoClient. Misc update on example and README (#50) 2018-06-01 16:14:42 -07:00
Prometheus
9e0a97916d Use AWS resource iface, overwrite default dynamodb, more explicit in example about overwrite default AWS resrouce client (#49)
* use custom kinesis client

* use aws sdk interface, add missing api for ddb

* add overwrite default dynamodbclien usage
2018-05-31 17:41:14 -07:00
Anant Prakash
2a5856ec99 Correct AWS_REGION (#48) 2018-05-30 06:45:38 -07:00
Anant Prakash
2fb47e63bc Fix typo in README.md (#47) 2018-05-24 08:34:10 -07:00
Tim Bart
4bdbbefa34 Use functional options to configure KinesisClient (#46) 2018-04-27 22:12:11 -07:00
Harlow Ward
64cdf69249
Add interval flush for DDB checkpoint (#40)
Add interval flush for DDB checkpoint

* Allow checkpointing on a specified interval
* Add shutdown method to checkpoint to force flush

Minor changes:

* Swap order of input params for checkpoint (app, table)

Addresses: https://github.com/harlow/kinesis-consumer/issues/39
2017-12-30 20:21:10 -08:00
Harlow Ward
955f74d553 Have new func return type 2017-11-26 18:22:09 -08:00
Harlow Ward
e5e057d6aa Add additional context to new comment 2017-11-26 18:17:41 -08:00
Harlow Ward
a62e7514e4 Make the Kinesis client exportable 2017-11-26 18:16:32 -08:00
Harlow Ward
b875bb56e7 Introduce Client Interface
Testing the components of the consumer where proving difficult because
the consumer code was so tightly coupled with the Kinesis client
library.

* Extract the concept of Client interface
* Create default client w/ kinesis connection
* Test with fake client to avoid round trip to kinesis
2017-11-26 16:00:11 -08:00
Harlow Ward
058f383e30 Add cancellation of pipeline from signal interrupts 2017-11-26 16:00:03 -08:00
Harlow Ward
89570130f5 Leverage bigger batchsize when seeding example data 2017-11-26 15:59:17 -08:00
Harlow Ward
edf0467eb0 Format errors from caller 2017-11-23 11:29:58 -08:00
Harlow Ward
86f1df782e Return the shard scan errors to top-level caller 2017-11-23 08:49:37 -08:00
Harlow Ward
b0245d688b Add more test coverage for Redis Checkpoint 2017-11-22 21:28:39 -08:00
Harlow Ward
6401371727 Simplify checkpoint interface; reduce input vars 2017-11-22 20:01:31 -08:00
Harlow Ward
3f081bd05a Fix position of input params for Options 2017-11-22 17:54:47 -08:00
Harlow Ward
4ffe3ec55a Add logs for start scan and checkpoints 2017-11-22 17:52:41 -08:00
Harlow Ward
3770136f64 Allow user to override no-op checkpoint with Option 2017-11-22 17:44:42 -08:00
Harlow Ward
c64b40b4ad Increment counts in correct usage points 2017-11-22 14:21:19 -08:00
Harlow Ward
c91f6233ef Add counter for exposing scanner metrics 2017-11-22 14:10:11 -08:00
Harlow Ward
84c0820f4a
Serverless options 2017-11-22 10:57:29 -08:00