0

I have a function who delivers email-s with payment bills to some subscribers, and because of it we have to queue this function to ensure that this e-mail will be delivered. So we started to use Google Cloud Tasks from GCP to it.

I created the queue like the doc's: GCP Cloud Task Documentation

My problem is that i don't know how to create and "put the function on the queue". I followed the doc's here: HTTP Tasks GCP docs but i never used GCP before.

where do i found these credentials specified on the second link above?

  // TODO(developer): Uncomment these lines and replace with your values.
  // const project = 'my-project-id';
  // const queue = 'my-queue';
  // const location = 'us-central1';
  // const url = 'https://example.com/taskhandler';
  // const payload = 'Hello, World!';
  // const inSeconds = 180;
  • I don't understand of which credential you are talking about. Is it [that](https://cloud.google.com/tasks/docs/creating-http-target-tasks#token)? with an OIDC token? – guillaume blaquiere Mar 31 '21 at 19:25
  • @guillaumeblaquiere i mean all these credential, in TODO(developer) As i said, i never used GCP before, and because of it i don't know were i can found this. Is this a token? I need to generate this somewhere on GCP? – lucas menezes Mar 31 '21 at 20:11
  • Are you able to create a task in task queue? If so, share your code to guide you on how to configure it to make the task able to call your Cloud Functions. If no, share you code to see where is the problem with your current task creation. – guillaume blaquiere Mar 31 '21 at 21:04
  • @guillaumeblaquiere I have full acess, actually i'm following the steps on the documentation https://cloud.google.com/tasks/docs/creating-http-target-tasks#node.js So i don't have to much to show you. I only downloaded the npm packages, and get stuck in this credentials, can i show show you a link on a jsfiddle or a github repo? – lucas menezes Mar 31 '21 at 21:20
  • Did you have installed `gcloud` sdk? If so, perform this command `gcloud auth application-default login`. You will be able to run the code on your computer, with your own credential, to access to Google Cloud APIs (and thus Cloud Task) – guillaume blaquiere Apr 01 '21 at 07:09
  • @guillaumeblaquiere It did helped me! I did a step foward! My problem now is that the terminal shows "error 5 NOT FOUND: Requested entity not found". Did you know what this means? i wrote a fiddle, could you have a look? https://jsfiddle.net/3dm6suLp/1/ – lucas menezes Apr 01 '21 at 20:37

0 Answers0