0

我想为 Amazon Kinesis 创建一个 POC。

在这篇文章http://seroter.wordpress.com/2014/01/09/data-stream-processing-with-amazon-kinesis-and-net-applications/的帮助下,我在 AWS 上创建了一个流和一些代码

using (MemoryStream ms = new MemoryStream(oByte))
{
    AmazonKinesisConfig config = new AmazonKinesisConfig();
        config.RegionEndpoint = Amazon.RegionEndpoint.USEast1;
    AmazonKinesisClient client = new AmazonKinesisClient(config);
    PutRecordRequest requestRecord = new PutRecordRequest();
        requestRecord.StreamName = "POC";   
    requestRecord.PartitionKey = "weborder";
        requestRecord.Data = ms;
    try
        {
            var responseRecord = client.PutRecord(requestRecord);       
    }
        catch (Exception ex)
        {
            var t = ex.Message; 
    }
        lblShardId.Text = "Shard ID: " + responseRecord.ShardId;
        lblSequence.Text = "Sequence #:" + responseRecord.SequenceNumber;                
}

我收到异常 Amazon.Kinesis.Model.ResourceNotFoundException: Stream POC under account 111111111111 not found。

4

1 回答 1

1

您是否验证了管理员创建流的区域?更容易检查流是否存在并将其创建为 POC 应用程序的一部分(如果您使用的密钥具有权限)

var response = CreateStream(new Amazon.Kinesis.Model.CreateStreamRequest()
                    {
                        ShardCount = shardCount,
                        StreamName = name
                    });
于 2015-01-02T07:53:24.770 回答