繁体   English   中英

将 AWS Kinesis 与 localstack 和 Apache Flink 入口一起使用

[英]Using AWS Kinesis with localstack and Apache Flink ingress

我有 localstack 在我的 Docker 中运行模拟 Kinesis ZF7B44CFFAFD5C52223D5498196C8A2E7BZ 在http://localstack:4645撰写

我正在使用 Flink Kinesis ingress io 类型尝试连接到 stream。

https://nightlies.apache.org/flink/flink-statefun-docs-release-3.2/docs/modules/io/aws-kinesis/

按照上面我创建

kind: io.statefun.kinesis.v1/ingress
spec:
  id: com/sentiment
  awsRegion:
    type: specific
    id: us-east-1
  awsCredentials:
    type: custom-endpoint
    endpoint: https://localhost:4566
    id: us-east-1
    accessKeyId: key
    secretAccessKey: secret
  startupPosition:
    type: latest
  streams:
    - stream: customer-details
      valueType: namespace/SentimentEvent
      targets:
        - namespace/sentiment
  clientConfigProperties:
    - SocketTimeout: 9999
    - MaxConnections: 15

然后我启动我的 Docker Compose 文件,其中包含 Flink StateFun 图像,但我在日志中收到此错误:

Caused by: org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.JsonMappingException: Invalid AWS credential type: custom-endpoint; valid values are [default, basic, profile] (through reference chain: org.apache.flink.statefun.flink.io.kinesis.binders.ingress.v1.RoutableKinesisIngressSpec$Builder["awsCredentials"])

正如文档所说,这令人困惑:

Custom Endpoint #
Connects to an AWS region through a non-standard AWS service endpoint. This is typically used only for development and testing purposes.

awsCredentials:
  type: custom-endpoint
  endpoint: https://localhost:4567
  id: us-west-1

但这似乎不是有效的配置。

我可以使用awslocal工具和我的 Docker Compose 中的其他应用程序访问 Localstack stream,所以我知道这不是问题所在。

我看不出似乎解决了这个问题。

原来端点需要 go 在配置的 awsRegion 部分下。

  awsRegion:
    type: custom-endpoint
    id: us-east-1
    endpoint: https://localstack:4566

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM