Google Cloud Tasks get response message

Viewed 274

I am using Google Cloud Tasks for asynchronous communication between HTTP microservices. My task handler is a simple Java Spring application. I am wondering if there is any way to get response message in case that a task gets failed using GET TASK API CALL. Currently I can see the HTTP response status in lastAttempt.responseStatus.code field but the lastAttempt.responseStatus.details field is empty. The documentation states Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. So I assume that I have to set the lastAttempt.responseStatus.details field with my response message, although I have no idea how to do this.

0 Answers
Related