简体   繁体   English

将 DynamoDB 与 Vert.x 结合使用

[英]Using DynamoDB with Vert.x

I am using Vert.x and I am trying to get items from DynamoDB table, by sort key and partition key.我正在使用 Vert.x,我正在尝试通过排序键和分区键从 DynamoDB 表中获取项目。 Here is how I build the client这是我构建客户端的方式

private static DynamoDbAsyncClient buildDynamoDBAsyncClient(final Vertx vertx) {
        return VertxSdkClient.withVertx(DynamoDbAsyncClient.builder(), vertx.getOrCreateContext())
                .build();
    }

And how I request the data.以及我如何请求数据。

    private List<CompletableFuture<List<Map<String, Object>>>> getOverrideMetadataRecord(Promise<OverrideMetadataEntry> promise) {
        final List<CompletableFuture<List<Map<String, Object>>>> resultList = new ArrayList<>();

                    final Map<String, KeysAndAttributes> requestItems = new HashMap<>();
                    requestItems.put(tableName, KeysAndAttributes.builder().keys(Arrays.asList(createMapKeyToGet())).build());
                    final BatchGetItemRequest batchGetItemRequest = BatchGetItemRequest.builder()
                            .requestItems(requestItems).build();
                    final CompletableFuture<List<Map<String, Object>>> futureBatchResponseData =
                            dynamoDbAsyncClient.batchGetItem(batchGetItemRequest).thenApply(this::getResponseData);
                    resultList.add(futureBatchResponseData);

                    return resultList;

    }

I don't receive any objects and then I get operation timeout.我没有收到任何对象,然后我得到操作超时。 What am I missing?我错过了什么? thank you in advance先感谢您

Don't post the same question twice just cause you want an answer fast.不要为了快速获得答案而两次发布相同的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM