private void HttpClientSendPutRecordsRequest(PutRecordsRequest prr) { StdErrorOut.Instance.StdOut(LogLevel.debug, "Pipeline.send_put_records_request"); AwsHttpRequest kinesisRequest = AwsHttp.create_kinesis_request(this.region_, "PutRecords", prr.serialize()); try { RequestSigner.sign_v4(kinesisRequest, this.sig_v4_ctx_); StdErrorOut.Instance.StdOut(LogLevel.debug, "after RequestSigner.sign_v4(request, sig_v4_ctx_)"); this.http_client_.put(kinesisRequest, (Action <AwsHttpResult>)(result => this.retrier_put(result)), (object)prr, prr.Deadline(), prr.Expiration()); StdErrorOut.Instance.StdOut(LogLevel.debug, "http_client_.put"); } catch (Exception ex) { this.retrier_.put(new AwsHttpResult(ex.ToString(), (object)prr, DateTime.Now, DateTime.Now)); } }
private void HttpClientUpdate(string start_shard_id) { StringBuilder sb = new StringBuilder(); sb.Append("{\"StreamName\":\"").Append(stream).Append("\""); if (!string.IsNullOrEmpty(start_shard_id)) { sb.Append(",\"ExclusiveStartShardId\":\"").Append(start_shard_id).Append("\""); } sb.Append("}"); var req = AwsHttp.create_kinesis_request(region, "DescribeStream", sb.ToString()); var ctx = new SigV4Context(region, "kinesis", creds_provider); try { RequestSigner.sign_v4(req, ctx); http_client.put(req, (r) => { update_callback(r); }, null, DateTime.Now, DateTime.Now); } catch (Exception e) { update_callback(new AwsKinesisResult(e.ToString(), null, DateTime.Now, DateTime.Now)); } }