Protocol buffers 使用grpc和protobuf(生成的客户端)通过HTTP 2访问Google Cloud Pubsub

Protocol buffers 使用grpc和protobuf(生成的客户端)通过HTTP 2访问Google Cloud Pubsub,protocol-buffers,google-cloud-pubsub,grpc,Protocol Buffers,Google Cloud Pubsub,Grpc,我正在尝试使用google cloud pubsub服务,方法是使用 我能够生成客户端代码,并使用以下代码获取主题: ManagedChannelImpl channelImpl = NettyChannelBuilder .forAddress("pubsub.googleapis.com", 443) .negotiationType(NegotiationType.TLS) .b

我正在尝试使用google cloud pubsub服务,方法是使用

我能够生成客户端代码,并使用以下代码获取主题:

        ManagedChannelImpl channelImpl = NettyChannelBuilder
                .forAddress("pubsub.googleapis.com", 443)
                .negotiationType(NegotiationType.TLS)
                .build();

        ClientAuthInterceptor interceptor = new ClientAuthInterceptor(
                GoogleCredentials.getApplicationDefault().createScoped(SCOPES),
                ForkJoinPool.commonPool());
        Channel channel = ClientInterceptors.intercept(channelImpl, interceptor);
        PublisherBlockingClient publisher = newBlockingStub(channel);
        Topic topicInstance;
        try {
            topicInstance = publisher.getTopic(GetTopicRequest.newBuilder().setTopic(topic).build());
            if (topicInstance != null) {
                logger.info("Found existing topic: {}", topicInstance.getName());
                return publisher;
            }
        } catch (Exception ex) {
            logger.info("Unable to find topic: {}", topic);
        }
对于404,这总是失败的。网络通信量(在调试日志记录中)似乎确认客户端正在访问错误的端点(对于发布消息请求):


我做错了什么?是否支持HTTP 2上的pubsub(使用protobuf)?

截至2015年12月17日,我们尚未在
pubsub.googleapis.com
端点上启用gRPC。现在,我们正在积极测试gRPC支持,希望能在不久的将来提供。

这仍然有效吗?我看到了一些grpc样品,想知道这是否可能。
DEBUG 2015-12-17 00:58:07,962 [grpc-default-worker-ELG-0] i.g.n.NettyClientTransport: 
----------------OUTBOUND--------------------
HEADERS: streamId=5, headers=DefaultHttp2Headers[:authority: pubsub.googleapis.com:443, :path: /google.pubsub.v1.Publisher/Publish, :method: POST, :scheme: https, authorization: Bearer ya29.TQIWiptEf4KsAKObPIaLaJRcq49SQ2vAutO4eIC-kgM4XwvX9p-9sFBR4eNfzE_yLiBs1A, content-type: application/grpc, te: trailers, user-agent: grpc-java-netty/0.9.0], streamDependency=0, weight=16, exclusive=false, padding=0, endStream=false
------------------------------------
DEBUG 2015-12-17 00:58:07,975 [grpc-default-worker-ELG-0] i.g.n.NettyClientTransport: 
----------------OUTBOUND--------------------
DATA: streamId=5, padding=0, endStream=true, length=725, bytes=00000002d00a136465765f616368617568616e2d6576656e747312b8050af9047b22486f7374223a226c6f63616c686f73743a3434303830222c22436f6e6e65...
------------------------------------
DEBUG 2015-12-17 00:58:11,492 [grpc-default-worker-ELG-0] i.g.n.NettyClientTransport: 
----------------INBOUND--------------------
HEADERS: streamId=5, headers=DefaultHttp2Headers[:status: 404, date: Thu, 17 Dec 2015 08:58:08 GMT, content-type: text/html; charset=UTF-8, server: ESF, content-length: 1595, x-xss-protection: 1; mode=block, x-frame-options: SAMEORIGIN, x-content-type-options: nosniff, alternate-protocol: 443:quic,p=1, alt-svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"], padding=0, endStream=false
------------------------------------
DEBUG 2015-12-17 00:58:26,357 [grpc-default-worker-ELG-0] i.g.n.NettyClientTransport: 
----------------INBOUND--------------------
DATA: streamId=5, padding=0, endStream=true, length=1595, bytes=3c21444f43545950452068746d6c3e0a3c68746d6c206c616e673d656e3e0a20203c6d65746120636861727365743d7574662d383e0a20203c6d657461206e61...
------------------------------------
DEBUG 2015-12-17 00:58:26,357 [grpc-default-worker-ELG-0] i.g.n.NettyClientTransport: 
----------------INBOUND--------------------
PING: ack=false, length=8, bytes=0000000000000002
------------------------------------
DEBUG 2015-12-17 00:58:26,358 [grpc-default-worker-ELG-0] i.g.n.NettyClientTransport: 
----------------OUTBOUND--------------------
PING: ack=true, length=8, bytes=00000000000000