use of software.amazon.awssdk.services.kinesis.KinesisClient in project aws-doc-sdk-examples by awsdocs.
the class CreateDataStream method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <streamName>\n\n" + "Where:\n" + " streamName - The Amazon Kinesis data stream (for example, StockTradeStream).\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String streamName = args[0];
Region region = Region.US_EAST_1;
KinesisClient kinesisClient = KinesisClient.builder().region(region).build();
createStream(kinesisClient, streamName);
System.out.println("Done");
kinesisClient.close();
}
use of software.amazon.awssdk.services.kinesis.KinesisClient in project aws-doc-sdk-examples by awsdocs.
the class StockTradesWriter method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <streamName>\n\n" + "Where:\n" + " streamName - The Amazon Kinesis data stream to which records are written (for example, StockTradeStream)\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String streamName = args[0];
Region region = Region.US_EAST_1;
KinesisClient kinesisClient = KinesisClient.builder().region(region).build();
// Ensure that the Kinesis Stream is valid
validateStream(kinesisClient, streamName);
setStockData(kinesisClient, streamName);
kinesisClient.close();
}
use of software.amazon.awssdk.services.kinesis.KinesisClient in project aws-doc-sdk-examples by awsdocs.
the class GetRecords method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <streamName>\n\n" + "Where:\n" + " streamName - The Amazon Kinesis data stream to read from (for example, StockTradeStream).\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String streamName = args[0];
Region region = Region.US_EAST_1;
KinesisClient kinesisClient = KinesisClient.builder().region(region).build();
getStockTrades(kinesisClient, streamName);
kinesisClient.close();
}
use of software.amazon.awssdk.services.kinesis.KinesisClient in project aws-doc-sdk-examples by awsdocs.
the class ListShards method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <streamName>\n\n" + "Where:\n" + " streamName - The Amazon Kinesis data stream (for example, StockTradeStream)\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String name = args[0];
// snippet-start:[kinesis.java2.ListShards.client]
Region region = Region.US_EAST_1;
KinesisClient kinesisClient = KinesisClient.builder().region(region).build();
// snippet-end:[kinesis.java2.ListShards.client]
listKinShards(kinesisClient, name);
kinesisClient.close();
}
Aggregations