问题标签 [google-cloud-pubsublite]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
30 浏览

google-cloud-platform - 具有峰值容量吞吐量选项的 Pub Sub Lite 主题

我们正在使用 Pub Sub lite 实例和预留,我们希望通过 Terraform 在 UI 上部署它,同时创建 Pub Sub Lite 我们可以选择指定峰值发布吞吐量 (MiB/s) 和峰值订阅吞吐量 (MiB/s)根据此文档https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/pubsub_lite_topic,资源“google_pubsub_lite_topic”中不可用。

发表文章

目前使用上述TF脚本创建pub sub lite实例,这里的问题是我们提到吞吐能力而不是设置峰值吞吐能力,而容量块是必填项。如果有任何解决方法,请帮忙?我们希望主题动态设置吞吐量,但对吞吐量有峰值限制,因为我们正在为精简预留设置一个固定值。

0 投票
2 回答
161 浏览

publish-subscribe - spring cloud gcp pub sub和google cloud pub sub的区别

如果我想向 Google PubSub 发送消息并从中使用消息。您建议使用 Spring Cloud GCP 库还是仅使用 Google Cloud Java API。

与谷歌云 pubsub 库相比,任何人都可以区分这两者或 spring cloud gcp 提供的功能。

0 投票
0 回答
45 浏览

python - 基于 Pub sub lite 分区的均匀分布数据

我是 GCP 的新手,在 Lite Topics 中创建了 2 个分区。我正在尝试发布 8 个文件,这些文件应该平均分布在这 2 个分区上。是否有可能在 Python 中做到这一点?到目前为止,请参阅此文档 https://cloud.google.com/pubsub/lite/docs/publishing

0 投票
2 回答
101 浏览

c# - C# 中的 Google Cloud PubSub Lite 订阅

我正在使用 C# 语言编写软件,我需要在 Google Cloud 中创建对 Pub/Sub Lite 的订阅。我知道我不能使用 Google.Cloud.PubSub.V1 nuget 包,因为它不适用于 Lite 版本。我找到了 Google.Apis.PubsubLite.V1 nuget 包,但我还没有找到如何创建订阅并从 Pub/Sub Lite 读取数据的示例。我怎么能这样做?

0 投票
1 回答
61 浏览

python - 在 pubsub lite 接收消息中找不到 PubsubMessage 和 MessageMetadata


我正在关注 PubSub lite 的以下文档,并尝试接收我使用以下代码发布的消息。回调函数中出现错误。
https://cloud.google.com/pubsub/lite/docs/subscribing
发布消息

0 投票
1 回答
58 浏览

google-cloud-platform - Pubsublite 订阅第一条消息的速度非常慢

我正在使用 GCP pubsublite,带有一个分区的天真主题,一些消息。Python 客户端库。执行标准订阅、订阅客户端、subscribe回调方法。从调用方法到收到第一条消息之间,大约需要 30 秒。后续消息很快,因为它们已经在缓存中。

关于极长发作的问题:预期吗?还是有一些常见的嫌疑人?

感谢指点。

编辑:代码粘贴在下面。它在编辑凭据后在 Docker 中运行。我的打印输出是

0 投票
2 回答
64 浏览

python - Pubsublite message acknowledgement not working

I'm using Google pubsublite. Small dummy topic with single partition and a few messages. Python client lib. Doing the standard SubscriberCluent.subscribe with callback. The callback places message in a queue. When the msg is taken out of the queue for consumption, its ack is called. When I want to stop, I call subscribe_future.cancel(); subscriber_future.result() and discard unconsumed messages in the queue.

Say I know the topic has 30 messages. I consume 10 of them before stopping. Then I restart a new SubscriberClient in the same subscription and receive messages. I expect to get starting with the 11th message, but I got starting with the first. So the precious subscriber has ack'd the first 10, but it's as if server did not receive the acknowledgement.

I thought maybe the ack needs some time to reach the server. So I waited 2 minutes before starting the second subscribe. Didn't help.

Then u thought maybe the subscriber object manages the ack calls, and I need to "flush" them before cancelling, but I found another about that.

What am I missing? Thanks.

Here's the code. If you have pubsublite account, the code is executable after you fill in credentials. The code shows two issues, one is the subject of this question; the other is asked at here