Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDKRequestAdapter hangs/times out on POST operations #206

Open
EricWittmann opened this issue Dec 5, 2024 · 0 comments
Open

JDKRequestAdapter hangs/times out on POST operations #206

EricWittmann opened this issue Dec 5, 2024 · 0 comments

Comments

@EricWittmann
Copy link
Collaborator

Reproducer:

  1. Run Apicurio Registry:
docker pull apicurio/apicurio-registry:3.0.5
docker run apicurio/apicurio-registry:3.0.5
  1. Run the reproducer class
package io.apicurio.registry.rbac;

import com.microsoft.kiota.RequestAdapter;
import io.apicurio.registry.rest.client.RegistryClient;
import io.apicurio.registry.rest.client.models.CreateGroup;
import io.apicurio.registry.rest.client.models.ProblemDetails;
import io.apicurio.registry.rest.client.models.SystemInfo;
import io.kiota.http.jdk.JDKRequestAdapter;

public class TestJDKRequestAdapter {
    public static void main(String[] args) {
        try {
            RequestAdapter adapter = new JDKRequestAdapter();
            adapter.setBaseUrl("http://localhost:8080/apis/registry/v3");
            var client = new RegistryClient(adapter);
            SystemInfo systemInfo = client.system().info().get();
            System.out.println(systemInfo.getName());
            System.out.println(systemInfo.getDescription());

            CreateGroup createGroup = new CreateGroup();
            createGroup.setGroupId("test-group");
            client.groups().post(createGroup);
        } catch (ProblemDetails e) {
            System.err.println(e.getName());
            System.err.println(e.getTitle());
            System.err.println(e.getDetail());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

If you run that the system.info call will work, but the group creation will hang. It might eventually fail with a "stream closed" error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant