Search code examples
javaprotocol-buffersgrpcpolyglot

Using polyglot to query GRPC service and pass timestamp as one of the request parameters


From the command line I am calling polyglot to query a GRPC service. The request object that I am constructing has an attribute for TimeStamp called 'as_of'. How do I pass a valid timestamp? What should be the format and how do I generate one?

I tried sending '2019/03/05 23:59' but that didn't work. Below is my command line call to the grpc service.

echo -n '{"source_system": "TEST", "customer_id": 20100, "as_of": "2019/03/05 23:59"}' | java -jar ~/support/lib/polyglot.jar --command=call --endpoint=localhost:10443 --full_method='comp.test.model.TradeService/GetDeals' 2> /dev/null


Solution

  • Timestamp is encoded as RFC 3339 in JSON. So it should look like 2019-03-05T23:59:00Z.