Skip to content

bug: DynanmoStreams don't work with the SDK #11599

Closed
@toadzky

Description

@toadzky

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I can poll the shard for records indefinitely, even if I'm writing to the table, and no records will ever show up. I also tried enabling the kinesis configuration, but saw no results with the kinesis client either.

Based on looking through the code, the main problems seems to be that you don't actually use the built-in streams functionality in dynamodb-local. You intercept the calls and use an internal fake - which never actually spits out records to the sdk.

Expected Behavior

Records actually show up as documented in the SDK. Ideally, you'd stop intercepting the calls and just use the dynamodb-local because it's more consistent and correct by far.

How are you starting LocalStack?

Custom (please describe below)

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

Testcontainers in Junit

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

    var iterator: String = streams.getShardIterator { it.streamArn(streamArn).shardId(shardId).shardIteratorType(TRIM_HORIZON) }.shardIterator()

    val response = streams.getRecords { it.shardIterator(currentIterator) }
    iterator = response.nextShardIterator()

    if (response.records().isEmpty()) {
      log.debug { "No records found on stream. table=$table" }
      return
    }
    
    // do something with the records

Environment

- OS: macOS
- LocalStack Docker image sha: sha256:8569dadc82ddf0627569775dde517297351691ddbe28e60edd1f515b46f7ef2e

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions