question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do you reject work with the GRPC ext client?

See original GitHub issue

In the dapr-ext-grpc documentation page, we see the following example for subscribing to TOPIC_A on the pubsub publish subscribe component.

@app.subscribe(pubsub_name='pubsub', topic='TOPIC_A')
def mytopic(event: v1.Event) -> None:
    print(event.Data(),flush=True)

The document doesn’t say how one ACKs a message. Are messages ACKed when the decorated function (mytopic, in the example above) is called, or when it returns?

If a message is only ACKed when the decorated function returns, how do I prevent redelivery when the decorated function needs to do a long-running operation? Or how do I reject work until a long-running operation completes?

What happens if an exception is raised from the decorated function? Will dapr try to redeliver the message?

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
wcs1onlycommented, Jan 13, 2022

One approach would be to allow the callback function to return a TopicEventResponse object.

0reactions
renatolfccommented, Jan 14, 2022

#336 is my attempt at solving this issue following @wcs1only’s suggestion.

Please let me know if it needs improvements, as it’d be super nice for me to be able to intruct dapr to retry/reject messages when using the grpc client.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced gRPC Error Usage
One workaround for this is to register your error metadata messages with golang/protobuf through the goproto_registration extension.
Read more >
How to use the @grpc/grpc-js.status function in @grpc/grpc-js
To help you get started, we've selected a few @grpc/grpc-js.status ... the decode as a string return reject(callErrorFromStatus({ code: grpc.status.
Read more >
Re: Unable to connect to Cloud Run gRPC server
I'm trying to deploy a Cloud run gRPC server, by now I've accomplished the deployment but when I try to connect and call...
Read more >
Authentication
Using client-side SSL/TLS. Now let's look at how Credentials work with one of our supported auth mechanisms. This is the simplest authentication ...
Read more >
gRPC API Reference - Camunda Platform 8 Docs
As the gRPC server/client is based on generated code, keep in mind that any ... the job type, as defined in the BPMN...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found