我已经使用编码 [1] 启动了 google pub sub 的发布者。完成发布者后,我将发布者关闭为 [2]。但是当我运行时,我收到一个错误 [3],说发布者不正确关掉。我正在使用 pubsub 1.61.0 版本。有没有办法处理这个错误?
[1]
public class PublisherExample {
// use the default project id
private static final String PROJECT_ID = ServiceOptions.getDefaultProjectId();
/** Publish messages to a topic.
* @param args topic name, number of messages
*/
public static void main(String... args) throws Exception {
// topic id, eg. "my-topic"
String topicId = args[0];
int messageCount = Integer.parseInt(args[1]);
ProjectTopicName topicName = ProjectTopicName.of(PROJECT_ID, topicId);
Publisher publisher = null;
List<ApiFuture<String>> futures = new ArrayList<>(); …Run Code Online (Sandbox Code Playgroud) 我正在使用 Google 发布商代码在我的游戏中展示广告。我的游戏是一个 Android 应用程序内的网页视图。为了实现这一点,我正在加载这个脚本https://securepubads.g.doubleclick.net/tag/js/gpt.js。
我发现上面的脚本内部也tpc.googlesyndication.com/sodar/sodar2.js用file://协议加载这个脚本。广告正在显示,但我的游戏因此崩溃。我尝试搜索导致此问题的原因,但找不到任何解决方案。主要是我对两件事有疑问。
tpc.googlesyndication.com/sodar/sodar2.js脚本。如果没有必要,我们可以避免这种情况吗?file://协议,我们如何避免这种情况?我是第一次尝试 Google 发布商代码,如果我有什么错误,请纠正我。
我正在将 Google 发布商标签库集成到网络应用程序的客户端。Google 发布商代码库 (gpt.js) 触发加载 tpc.googlesynmination.com/sodar/sodar2.js 脚本。这个sodar2.js脚本有什么用?
我将以下 json 插入到预先创建的 BigQuery 表中。
\n\n{\n "Member_ID": 881230,\n "First_Name": "Dave2",\n "Last_Name": "Manin2",\n "Gender": "M",\n "Age": 53,\n "Height": "5,2",\n "Weight": 145,\n "Hours_Sleep": 4,\n "Calories_Consumed": 2497,\n "Exercise_Calories_Burned": 876,\n "Date": "2018-10-17"\n}\nRun Code Online (Sandbox Code Playgroud)\n\n当我将上面的行直接插入表中时,它工作正常,但通过函数出错(请参阅下面的完整错误消息)。我缺少什么?任何帮助表示赞赏。
\n\n这是我的node.js(代码后的错误消息)
\n\nexports.subscribe = function (event, callback) {\n const BigQuery = require(\'@google-cloud/bigquery\');\n const projectId = "mydemo-221920"; //Enter your project ID here\n const datasetId = "mydemodata"; //Enter your BigQuery dataset name here\n const tableId = "memid"; //Enter your BigQuery table name here -- make sure it is setup correctly\n …Run Code Online (Sandbox Code Playgroud) google-bigquery google-cloud-platform google-cloud-functions google-publisher-tag