use of com.amazonaws.services.kinesisfirehose.AmazonKinesisFirehose in project aws-ingesting-click-logs-using-terraform by aws-samples.
the class ClickLoggerHandler method updateClickLogRequestToStream.
private Boolean updateClickLogRequestToStream(ClickLogRequest clickLogRequest) {
System.out.println("Inside updateClickLogRequestToStream method for the input");
try {
AmazonKinesisFirehose amazonKinesisFirehoseClient = AmazonKinesisFirehoseClientBuilder.standard().withRegion(region).build();
PutRecordRequest putRecordRequest = new PutRecordRequest();
putRecordRequest.setDeliveryStreamName(stream_name);
Gson gson = new Gson();
String messageJson = gson.toJson(clickLogRequest);
System.out.println("gson - " + messageJson);
Record record = new Record().withData(ByteBuffer.wrap(messageJson.toString().getBytes()));
putRecordRequest.setRecord(record);
PutRecordResult putRecordResult = amazonKinesisFirehoseClient.putRecord(putRecordRequest);
System.out.println("updated the stream for recordid - " + putRecordResult.getRecordId());
return true;
} catch (Exception e) {
System.out.println("Error occurred - " + e.getMessage());
}
return false;
}
use of com.amazonaws.services.kinesisfirehose.AmazonKinesisFirehose in project camel by apache.
the class KinesisFirehoseComponentIntegrationTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
AmazonKinesisFirehose client = AmazonKinesisFirehoseAsyncClientBuilder.defaultClient();
JndiRegistry registry = super.createRegistry();
registry.bind("FirehoseClient", client);
return registry;
}
Aggregations