1 回答

TA贡献1821条经验 获得超5个赞
您可以尝试将值更改为以下内容:
http://pubsub_emulator:8085
作为抱怨丢失的错误protocol,预计会出现http在您的情况下
根据Apache Beam SDK,该值应为完全限定的 URL:
// getPubsubRootUrl
@Default.String(value="https://pubsub.googleapis.com")
@Hidden
java.lang.String getPubsubRootUrl()
// Root URL for use with the Google Cloud Pub/Sub API.
但是,如果您来自 python 背景,您会注意到这里显示的使用gRPC Python的Python SDK只需要包含地址和端口的服务器地址
# A snippet from google-cloud-python library.
if os.environ.get("PUBSUB_EMULATOR_HOST"):
kwargs["channel"] = grpc.insecure_channel(
target=os.environ.get("PUBSUB_EMULATOR_HOST")
)
grpc.insecure_channel(target, options=None)
Creates an insecure Channel to a server.
The returned Channel is thread-safe.
Parameters:
target – The server address
添加回答
举报