asyncReply doesn't work

Hi,
I am trying to run a sample application on my local machine.
If I run this code in an Action to create a Product, it is working fine

private Effect<String> onOneCommandInToManyCommandsOut(CreateProductsCommand createProductCommand) {
    Product product = createProductCommand.products().get(0);
    ProductEntity.CreateProductCommand cmd = toCommand(product);
    return effects().forward(callFor(cmd));
  }
  
  private DeferredCall<Any, String> callFor(ProductEntity.CreateProductCommand command) {
    log.info("Trying to Create Product: "+ command.skuId());
    return componentClient.forEventSourcedEntity(command.skuId())
            .call(ProductEntity::create)
            .params(command);
  }

However, If I use asyncReply + execute() the API requests just times out without any error on the console

private Effect<String> onOneCommandInToManyCommandsOut(CreateProductsCommand createProductCommand) {
    Product product = createProductCommand.products().get(0);
    ProductEntity.CreateProductCommand cmd = toCommand(product);
    CompletionStage<String> reply = callFor(cmd);
    return effects().asyncReply(reply);
  }
 private Effect<String> onOneCommandInToManyCommandsOut(CreateProductsCommand createProductCommand) {
    log.info("Trying to Create Product: "+ command.skuId());
    return componentClient.forEventSourcedEntity(command.skuId())
            .call(ProductEntity::create)
            .params(command);
            .execute();
  }

My use-case: PUT a list of products the asynchronously creates Products and responds backs with “OK” when done.

Helper Methods:

private ProductEntity.CreateProductCommand toCommand(Product item) {
    log.info("Command: {}", item);
    return new ProductEntity.CreateProductCommand(
        item.skuId(),
        item.skuName(),
        item.description(),
        item.msrp());
  }

public Effect<String> create(@RequestBody CreateProductCommand command) {
    log.info("EntityId: {}\n_State: {}\n_Command: {}", entityId, currentState(), command);
    return Validator.<Effect<String>>start()
        .isEmpty(command.skuId(), "Cannot create Product without skuId")
        .onError(errorMessage -> effects().error(errorMessage, Status.Code.INVALID_ARGUMENT))
        .onSuccess(() -> effects()
            .emitEvent(currentState().eventFor(command))
            .thenReply(__ -> "OK"));
  }

Hi @amittikoo84
Can you tell which kalixa-jvm-sdk you are using? I would start with updating to the latest 1.3.5 version, where we fixed an issue with the component client.

I was at 1.3.3 and upgraded to 1.3.5

<kalix-sdk.version>1.3.5</kalix-sdk.version>

Error

inv-kalix-demo-kalix-proxy-1  | {"timestamp":"2023-12-06T17:21:30.547Z","mdc":{"akkaAddress":"akka://kalix-proxy@172.24.0.2:25520","akkaUid":"-2920781688237874739","sourceThread":"kalix-proxy-akka.actor.default-dispatcher-8","akkaSource":"akka.actor.ActorSystemImpl(kalix-proxy)","sourceActorSystem":"kalix-proxy","akkaTimestamp":"17:21:30.547UTC"},"logger":"akka.actor.ActorSystemImpl","message":"Request timeout encountered for request [PUT /product-ui/create-products Strict(200 bytes)]","severity":"INFO","thread":"kalix-proxy-akka.actor.default-dispatcher-8","version":"1.1.18"}

Can you bump kalix-proxy to 1.1.24 ?

Tried. Same issue. I see the following error in my docker container logs:

2023-12-06 22:05:54 {"timestamp":"2023-12-07T06:05:54.161Z","logger":"kalix.proxy.VersionCheck$","message":"Failure checking the latest [java-spring] SDK on [https://docs.kalix.io/java-spring/_attachments/latest-version.txt]. Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target ","severity":"WARN","thread":"kalix-proxy-akka.actor.default-dispatcher-7","version":"1.1.24"}

I believe this is happening because the docker container doesn’t have access tot he zcaler.crt certificate. Do we have an example of how we can add it through docker-compose.

We have done something similar in docker using

COPY Zscaler.crt /usr/local/share/ca-certificates/foo.crt
RUN chmod 644 /usr/local/share/ca-certificates/foo.crt && update-ca-certificates

I am not sure how to do it using docker-compose

Failure checking the latest is just a warning it doesn’t effect the normal Kalix Runtime/Proxy work. Can you share some code snippet or repository so that I could reproduce the issue myself?