SubscriptionName subName = new SubscriptionName(_projectId, _subscriptionId);
try { SubscriberServiceApiClient subscriber = SubscriberServiceApiClient.Create(); //This is where the error started happening
var response = subscriber.Pull(subName, true, 10);
var allMessages = response.ReceivedMessages;
foreach (ReceivedMessage message in allMessages) { String id = message.Message.MessageId; String publishDate = message.Message.PublishTime.ToDateTime().ToString("dd-M-yyyy HH:MM:ss"); String data = message.Message.Data.ToStringUtf8();
TestLeadClass testing = Newtonsoft.Json.JsonConvert.DeserializeObject<TestLeadClass>(data);
Console.WriteLine(id); Console.WriteLine(publishDate); Console.WriteLine(testing.DisplayFullName() + testing.emptyStringTest); } return response; } catch (RpcException e) { Console.WriteLine("Its Broken: " + e); return null; } class TestLeadClass { public String firstname { get; set; } public String LastName { get; set; } public String emptyStringTest { get; set; }
public String DisplayFullName() { String fullName = "";
fullName = firstname + " " + LastName;
return fullName; } }--
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/34821425-c3bf-48c8-9e0a-945dba33f714%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/34821425-c3bf-48c8-9e0a-945dba33f714%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.