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

Can't consume message #424

Open
ziv-kalderon opened this issue Apr 4, 2021 · 1 comment
Open

Can't consume message #424

ziv-kalderon opened this issue Apr 4, 2021 · 1 comment

Comments

@ziv-kalderon
Copy link

Hey guys,
First of all, this package is exactly what we were looking for...
Second, currently the message consuming is not working for me with localstack
Do you have any experience with it?

My localstack docker-compose.yml

version: '2.1'

services:
  localstack-container:
    container_name: "localstack-container"
    privileged: true
    image: localstack/localstack:0.11.0
    ports:
      - "4566-4599:4566-4599"
      - "8081:8081"
    # https://github.com/localstack/localstack#configurations
    environment:
      - SERVICES=kinesis,dynamodb
      - DEBUG=1
      - DATA_DIR=/tmp/localstack/data
      - KINESIS_STREAM_SHARDS=1
      - KINESIS_ERROR_PROBABILITY=0.0
      - KINESIS_STREAM_NAME=my-stream
      - DEFAULT_REGION=us-east-1
    volumes:
      - "./localstack/tmp/localstack:/tmp/localstack"
      - "./localstack/tmp/localstack/run/docker.sock:/var/run/docker.sock"

My code:

 this.consumer = new KinesisClient({
      streamName: 'my-stream',
      accessKeyId: 'test',
      secretAccessKey: 'test',
      endpoint: 'http://127.0.0.1:4568',
     region: 'us-east-1',
      dynamoDb: {
        region: 'us-east-1',
      },
    });

 this.consumer.on('data', (data: any) => {
      console.log('Incoming data:', data);
    });
await this.consumer.startConsumer();

But nothing happens(and not errors)...
Any idea why?

@ziv-kalderon
Copy link
Author

So apparently you need accessKeyId And secret AccessKey for the dynamoDb as well

 dynamoDb: {
        region: 'us-east-1',
        endpoint: 'http://localhost:4566',
        accessKeyId: 'test',
        secretAccessKey: 'test',
      },

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

No branches or pull requests

1 participant