# (1) set up the client
# where to get the access/secret key
# see http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html
AWSCredentialsProvider credentialsProvider = new DefaultAWSCredentialsProviderChain();
ClientConfiguration clientConfig = new ClientConfiguration();
AmazonKinesis kinesis = new AmazonKinesisClient(credentialsProvider, clientConfig);
# what region you are in
kinesis.setRegion(Region.getRegion(Regions.EU_WEST_1));
# (2) send a put record
PutRecordRequest putRecord = new PutRecordRequest();
putRecord.setStreamName(streamName);
putRecord.setPartitionKey(partitionKeyString);
putRecord.setData(byteBuffer);
kinesis.putRecord(putRecord);
view raw kinesis-snippet.java hosted with ❤ by GitHub