google-cloud-pubsub

Google Cloud PubSub: Previously valid subscription suddenly unauthorized

亡梦爱人 提交于 2019-12-07 05:15:34
问题 I'm having some trouble with the Google Cloud PubSub API. Recently, I started using Cloud PubSub to queue messages for a chat server I'm working on. Messages coming in from a PubSub subscription are forwarded to users using the socket.io node library. I have no problems getting this set up - I run my node.js server, open up a couple browser windows, and I can chat away without any problems. I've noticed, however, that often after the server has been running for a few hours, that it starts

How to publish message in Google Pub/Sub from Firebase Cloud Function?

只愿长相守 提交于 2019-12-07 04:05:31
问题 I wrote a function that receive a http request and send a e-mail. But, I would like receive a http request and send a pub message. The problem is that the documentation is not clear. How I do that? This is my actual code. exports.weeklyEmail = functions.https.onRequest((req,res) => { const email = '****@gmail.com' console.log('Sending e-mail') const mailOptions = { to: email, from: '****@alunos.utfpr.edu.br', subject: 'Teste', text: 'Conteudo do email ' } mailTransport.sendMail(mailOptions)

How to verify ownership of Google Cloud Endpoints service URL?

孤人 提交于 2019-12-07 02:11:39
问题 I already set up Google Cloud Endpoints project and can invoke http/https requests. Endpoints gives me MY_API.endpoints.MY_PROJECT.cloud.goog domain name that I can use. I'm using gRPC Cloud Endpoints with HTTP/JSON to gRPC transcoding feature. It is deployed on Google Kubernetes Engine (deployment yaml script attached at the end). When I'm trying to create push subscription with that URL I getting next error: "The supplied HTTP URL is not registered in the subscription's parent project (url=

Unable to create Pipeline with PubsubIO.Read, Set up of resource … failed

被刻印的时光 ゝ 提交于 2019-12-07 01:33:27
My test pipeline is really simple. It attempts to read from a topic created via the console. public static void main(String[] args) throws IOException { Options options = PipelineOptionsFactory.fromArgs(args). withValidation().as(Options.class); options.setStreaming(true); Pipeline pipeline = Pipeline.create(options); PCollection<String> input = pipeline .apply(PubsubIO.Read.topic(options.getPubsubTopic())) .apply(ParDo.of(new ExtractEvents())); pipeline.run(); } When I attempt to execute this pipeline I get the following error: Workflow failed. Causes: (de5f777e2e08c1d9): Step setup_resource

Count number of unacknowledged messages in a Pubsub topic

Deadly 提交于 2019-12-06 15:21:32
I would like to perform an action once all the messages from a pubsub topic have been acknowledged. I tried using Stackdriver monitoring API for the metric "Number of unacknowledged messages broken down by a cloud region" but did not understand the filter for region and why it is required. Where can I see what region my topics use? And for some unknown reason, for some of the topics, the API call fails for no reason at all. What is the best way of knowing if all messages have been acknowledged or not. A Cloud Pub/Sub Topic has no concept of an unacknowledged message. This is purely a property

Does Google cloud Pub/Sub Support Letsencrypt certificates?

好久不见. 提交于 2019-12-06 13:08:52
This question is a follow up to Unable to configure Google Cloud Pub/Sub push subscriber As per the answer, self-signed certificates are not supported when using a push subscriber. Are certificates generated via letsencrypt client supported ? Is it recommended to use letsencrypt ? Yes. Sorry it took a long time, but I have verified that letsencrypt certs are working fine for this purpose. 来源: https://stackoverflow.com/questions/33790132/does-google-cloud-pub-sub-support-letsencrypt-certificates

gloud-java. PERMISSION_DENIED: Google Cloud Pub/Sub API (Experimental)

只谈情不闲聊 提交于 2019-12-06 12:26:55
问题 I use gloud-java experimental library. After update today, error occurred. Run example from library local (This error is automatically appeared in the google cloud flexible engine, although deploy not produced for a week) public class PullTest { private static final transient Logger logger = Logger.getLogger(MethodHandles.lookup().lookupClass().getName()); public static void main(String... args) throws Exception { try (PubSub pubsub = PubSubOptions.defaultInstance().service()) { String

PubSub REST subscription pull not returning with all messages

我只是一个虾纸丫 提交于 2019-12-06 12:01:03
We use the REST service API to pull messages from a PubSub subscription. Messages ready to be serviced are acknowledged, leaving other messages unacknowledged to be serviced during a later execution cycle. During an execution cycle, we send a single reqeust to the pull service REST API with returnImmediately=true and maxMessages=100 . While testing we encountered a situation when only 3 "old" messages would be returned during each execution cycle. Newly published messages were never included in the request to pull . We verified new messages were successfully arriving at the subscription by

Google iot core connection status

狂风中的少年 提交于 2019-12-06 11:26:06
I am using Google IOT core with mongoose os. I wanted to update device connection status to firestore. But i am unable to find event which reports mqtt connection status to pub/sub like when device disconnects or reconnect i.e if device is offline or not. I am stuck on this problem for days.Any help will be appreciated Update As @devunwired mentioned in this response it is now possible to monitor Stackdriver logs for disconnect events. You must have at a minimum enabled INFO level logging on your project in IoT Core > Registries > [your registry] > Edit Registry > Select "Info" log level >

Batching PubSub requests

倾然丶 夕夏残阳落幕 提交于 2019-12-06 11:21:28
The NODEJS example code for batching pubsub requests looks like this: // Imports the Google Cloud client library const PubSub = require(`@google-cloud/pubsub`); // Creates a client const pubsub = new PubSub(); /** * TODO(developer): Uncomment the following lines to run the sample. */ // const topicName = 'your-topic'; // const data = JSON.stringify({ foo: 'bar' }); // const maxMessages = 10; // const maxWaitTime = 10000; // Publishes the message as a string, e.g. "Hello, world!" or JSON.stringify(someObject) const dataBuffer = Buffer.from(data); pubsub .topic(topicName) .publisher({ batching: