use of com.amazonaws.services.kinesisfirehose.model.PutRecordRequest in project camel by apache.
the class KinesisFirehoseProducer method process.
@Override
public void process(Exchange exchange) throws Exception {
PutRecordRequest request = createRequest(exchange);
log.trace("Sending request [{}] from exchange [{}]...", request, exchange);
PutRecordResult putRecordResult = getEndpoint().getClient().putRecord(request);
log.trace("Received result [{}]", putRecordResult);
Message message = getMessageForResponse(exchange);
message.setHeader(KinesisFirehoseConstants.RECORD_ID, putRecordResult.getRecordId());
}
use of com.amazonaws.services.kinesisfirehose.model.PutRecordRequest in project camel by apache.
the class KinesisFirehoseProducer method createRequest.
private PutRecordRequest createRequest(Exchange exchange) {
ByteBuffer body = exchange.getIn().getBody(ByteBuffer.class);
Record record = new Record();
record.setData(body);
PutRecordRequest putRecordRequest = new PutRecordRequest();
putRecordRequest.setDeliveryStreamName(getEndpoint().getStreamName());
putRecordRequest.setRecord(record);
return putRecordRequest;
}
Aggregations