Class AccountManager

java.lang.Object
ai.pipestream.module.pipelineprobe.pipelinecrawl.AccountManager

@ApplicationScoped public class AccountManager extends Object
Resolves the test account for a RunPipelineCrawl run. Returns the resolved account_id directly — no futures, no observers, no helper wrappers. The injected AccountServiceGrpc.AccountServiceBlockingStub blocks the calling (virtual) thread until the response lands; on a VT that's a cheap park, on a platform thread it's a wasted thread, so callers must run on a virtual thread.

Wiring lives in application.properties: quarkus.grpc.clients.account-manager.* + quarkus.stork."account-manager".*. Quarkus's @GrpcClient annotation injects the stub; Stork resolves account-manager via Consul. No DynamicGrpcClientFactory, no per-call channel construction — this is the standard Quarkus pattern.

  • Constructor Details

    • AccountManager

      public AccountManager()
      Creates the account manager. Managed by CDI.
  • Method Details

    • resolveAccount

      public String resolveAccount(String requestedAccountId, String fallbackName)
      Resolve the test account: use the caller's preferred id if set, otherwise mint one and create it. Idempotent — if the account already exists the gRPC call returns created=false and we still return the same id.
      Parameters:
      requestedAccountId - the caller-supplied account id; when non-null and non-empty it is reused as-is
      fallbackName - the account name used when a new account is minted because no id was supplied
      Returns:
      the resolved account id (the supplied one, or a newly minted one)
    • getOrCreate

      public String getOrCreate(String accountId, String name)
      Idempotently create (or reuse) an account with a CALLER-CHOSEN id — used by tests that need a STABLE account across runs (e.g. the engine-perf harness's engineperf-<module>). The create call is idempotent on the platform side (created=false on reuse); both drives (<id>:intake + <id>:pipeline) are provisioned at creation.
      Parameters:
      accountId - the caller-chosen, stable account id to create or reuse
      name - the account name set on the create request
      Returns:
      the same accountId that was created or reused