Я использую Amazon-Kinesis-Producer версии 0.12.11 отсюда: https://jar -download.com / artifacts / com.amazonaws / amazon-kinesis-продуцента . Я уже перепробовал все версии от 0.12.6 до 0.12.11 и получил ту же ошибку, поддержка Windows была добавлена в версии начиная с 0.12.6+, так что это должно было сработать.
Работает на компьютере с Windows 10.
Я использую фрагмент кода из: https://docs.aws.amazon.com/streams/latest/dev/kinesis-kpl-writing.html, пытаюсь запустить код KPL для (синхронного ответа на результаты) с этой страницы.
Ниже мой код:
KinesisProducer kinesis = new KinesisProducer();
// Put some records and save the Futures
/*List<Future<UserRecordResult>> putFutures = new
LinkedList<Future<UserRecordResult>>();
for (int i = 0; i < 2; i++) {
ByteBuffer data;
try {
data = ByteBuffer.wrap("KPL Data".getBytes("UTF-8"));
// doesn't block
putFutures.add(
kinesis.addUserRecord("KinesisStream", "partitionkey", data));
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
// Wait for puts to finish and check the results
for (Future<UserRecordResult> f : putFutures)
{
UserRecordResult result;
try {
result = f.get();
if (result.isSuccessful()) {
System.out.println("Put record into shard " +
result.getShardId());
} else {
for (Attempt attempt : result.getAttempts()) {
// Analyze and respond to the failure
}
}
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ExecutionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} // this does block
}
Ниже приведена ошибка, которую я получаю:
Apr 23, 2019 11:29:20 AM com.amazonaws.services.kinesis.producer.KinesisProducer$MessageHandler onError
SEVERE: Error in child process
com.amazonaws.services.kinesis.producer.IrrecoverableError: Unexpected error connecting to child process
at com.amazonaws.services.kinesis.producer.Daemon.fatalError(Daemon.java:537)
at com.amazonaws.services.kinesis.producer.Daemon.access$1200(Daemon.java:63)
at com.amazonaws.services.kinesis.producer.Daemon$6.run(Daemon.java:460)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.nio.file.NoSuchFileException: \\.\pipe\amz-aws-kpl-in-pipe-017e4d05
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(Unknown Source)
at java.nio.channels.FileChannel.open(Unknown Source)
at java.nio.channels.FileChannel.open(Unknown Source)
at com.amazonaws.services.kinesis.producer.Daemon.connectToChild(Daemon.java:347)
at com.amazonaws.services.kinesis.producer.Daemon.access$1000(Daemon.java:63)
at com.amazonaws.services.kinesis.producer.Daemon$6.run(Daemon.java:457)
... 3 more
java.util.concurrent.ExecutionException: com.amazonaws.services.kinesis.producer.IrrecoverableError: Unexpected error connecting to child process
at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:299)
at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:286)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
at KPLSimple.main(KPLSimple.java:58)