public MessagePayload GetResponseInfoMessageFromServiceBus() { ServiceBusCRUD crudServiceBus = new ServiceBusCRUD(); var messagePayload = crudServiceBus.ReceiveMessages(); return(messagePayload); }
public void NotifyConsistencyService(FormResponseDetail hierarchicalFormResponseDetail) { var serviceBusCRUD = new ServiceBusCRUD(); //send notification to ServiceBus serviceBusCRUD.SendMessagesToTopic(hierarchicalFormResponseDetail); //ConsistencyHack(hierarchicalResponse); }
bool ReadFormDetailsFromServiceBus() { ServiceBusCRUD serviceBusCRUD = new ServiceBusCRUD(); serviceBusCRUD.ReceiveMessages(); return(true); }
public static MessagePayload ReadMessageFromServiceBus() { //Read Message from Service Bus var serviceBusCRUD = new ServiceBusCRUD(); var messagePayload = serviceBusCRUD.ReceiveMessages(); if (messagePayload == null) { //messagePayload.Body = "null"; return(messagePayload); } else { return(messagePayload); } }
public void ReadServiceBus() { MessagePayload messagePayload = null; messagePayload = ReadMessageFromServiceBus(); if (messagePayload == null) { ServiceBusCRUD _serviceBus = new ServiceBusCRUD(); _serviceBus.SendMessagesToTopic(GetFormResponDetails()); messagePayload = ReadMessageFromServiceBus(); FormResponseDetail _formSurveyData = GetFormResponDetailsFromJson(messagePayload); Assert.AreEqual(FormId, _formSurveyData.FormId); } else { FormResponseDetail formResponsefromServiceBus = JsonConvert.DeserializeObject <FormResponseDetail>(messagePayload.Body); Assert.AreEqual(FormId, formResponsefromServiceBus.FormId); } }
public void NotifyConsistencyService(IResponseContext responseContext, int responseStatus, RecordStatusChangeReason reasonForStatusChange) { if (responseStatus == RecordStatus.Deleted || responseStatus == RecordStatus.Saved) { try { var serviceBusCRUD = new ServiceBusCRUD(); var hierarchicalResponse = GetHierarchicalResponsesByResponseId(responseContext, includeDeletedRecords: true); var messageHeader = string.Format("{0},{1},{2}", responseContext.RootFormName, responseContext.RootFormId, responseContext.RootResponseId); var shouldNotify = ConsistencyServiceAttributeHelper.ShouldNotifyConsistencyService(reasonForStatusChange); if (shouldNotify) { //send notification to ServiceBus NotifyConsistencyService(hierarchicalResponse); //ConsistencyHack(hierarchicalResponse); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } }