8000 The httpTransportFactory is not used · Issue #1138 · googleapis/google-cloud-java · GitHub
[go: up one dir, main page]

Skip to content

The httpTransportFactory is not used #1138

@successhawk

Description

@successhawk

If you set the DatastoreOptions' builder's httpTransportFactory it is not used. The "create" method of the factory is never called. This does not allow me to configure a proxy. This is a defect, but is there a workaround to configure a proxy?

` public static Datastore createService() {
HttpTransportFactory httpTransportFactory = new HttpTransportWithProxyFactory();
return DatastoreOptions.builder()
.httpTransportFactory(httpTransportFactory).build().
se 5E13 rvice();
}

public static class HttpTransportWithProxyFactory implements HttpTransportFactory {

    public HttpTransport create() {
        // PUT BREAKPOINT ON NEXT LINE AND IT IS NEVER CALLED
        Proxy proxy = new Proxy(Type.HTTP, new InetSocketAddress("myproxy.com", 8080));
        HttpTransport t = new NetHttpTransport.Builder().setProxy(proxy).build();
        return t;
    }
}`

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0