private void Publish(MessageAction action, bool publishToOriginator = true, string additionalInfo = null) { Channel.Publish(new BackgroundTaskControllerMessage() { Action = action.ToString(), AdditionalInfo = additionalInfo }, PublishMethod.Immediate, options: PublishOptions.None, publishToOriginator: publishToOriginator); }
private Message CreateBaseMessage(MessageAction messageAction = MessageAction.Published, MessageContentType contentType = MessageContentType.JobProfile) { var message = A.Fake <Message>(); message.Body = Encoding.ASCII.GetBytes("Some body json object here"); message.UserProperties.Add("ActionType", messageAction.ToString()); message.UserProperties.Add("CType", contentType); return(message); }
public static void SendKISMessage(Part destPart, MessageAction action, AttachNode srcNode = null, Part tgtPart = null, AttachNode tgtNode = null) { BaseEventData bEventData = new BaseEventData(BaseEventData.Sender.AUTO); bEventData.Set("action", action.ToString()); bEventData.Set("sourceNode", srcNode); bEventData.Set("targetPart", tgtPart); bEventData.Set("targetNode", tgtNode); destPart.SendMessage("OnKISAction", bEventData, SendMessageOptions.DontRequireReceiver); }
private ResponseMessage ProcessAction(Func <bool> action, Message message, MessageAction messageAction) { ResponseMessage response; try { dynamic isConnectedResponse = new ExpandoObject(); var dict = (IDictionary <string, object>)isConnectedResponse; dict.Add(messageAction.ToString(), action().ToString()); response = BuildResponse(message.Id, JsonConvert.SerializeObject(isConnectedResponse), true); } catch (Exception e) { ErrorResponse[] errors = { new ErrorResponse() { Error = e.Message } }; response = BuildResponse(message.Id, message.Action.ToString(), false, errors); } return(response); }
public static void SendKISMessage(Part destPart, MessageAction action, Part tgtPart = null, AttachNode tgtNode = null) { BaseEventData bEventData = new BaseEventData(BaseEventData.Sender.AUTO); bEventData.Set("action", action.ToString()); bEventData.Set("targetPart", tgtPart); bEventData.Set("targetNode", tgtNode); destPart.SendMessage("OnKISAction", bEventData, SendMessageOptions.DontRequireReceiver); }
public MessageToArgs(MessageAction action, IMessage message) { Add(action.ToString(), message.Id.ToString()); }
private void GenerateServiceBusMessageForSocSkillsMatrixType(DynamicContent liveItem, DynamicContent masterItem, MessageAction eventAction) { DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager(Constants.DynamicProvider); var contentLinksManager = ContentLinksManager.GetManager(); var parentItemContentLinks = contentLinksManager.GetContentLinks() .Where(c => c.ParentItemType == ParentType && c.ChildItemId == masterItem.Id) .Select(c => c.ParentItemId).ToList(); var relatedSocSkillsMatrixContentTypes = GetSocSkillMatrixRelatedItems(liveItem, parentItemContentLinks, dynamicModuleManager, ParentType); serviceBusMessageProcessor.SendOtherRelatedTypeMessages(relatedSocSkillsMatrixContentTypes, liveItem.GetType().Name, eventAction.ToString()); }
private void GenerateServiceBusMessageForTextFieldTypes(DynamicContent item, MessageAction eventAction) { DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager(Constants.DynamicProvider); var contentLinksManager = ContentLinksManager.GetManager(); var parentItemContentLinks = contentLinksManager.GetContentLinks() .Where(c => c.ParentItemType == ParentType && c.ChildItemId == item.Id) .Select(c => c.ParentItemId).ToList(); var relatedTextFieldTypes = GetTextFieldRelatedItems(item, parentItemContentLinks, dynamicModuleManager, ParentType); serviceBusMessageProcessor.SendOtherRelatedTypeMessages(relatedTextFieldTypes, item.GetType().Name, eventAction.ToString()); }
private void GenerateServiceBusMessageForJobProfileUnPublish(DynamicContent item, MessageAction eventAction) { var jobProfileMessage = new JobProfileMessage(); jobProfileMessage.JobProfileId = item.OriginalContentId; jobProfileMessage.Title = dynamicContentExtensions.GetFieldValue <Lstring>(item, nameof(JobProfileMessage.Title)); serviceBusMessageProcessor.SendJobProfileMessage(jobProfileMessage, item.GetType().Name, eventAction.ToString()); }
private void GenerateServiceBusMessageForJobProfile(DynamicContent item, MessageAction eventAction) { JobProfileMessage jobprofileData = dynamicContentConverter.ConvertFrom(item); serviceBusMessageProcessor.SendJobProfileMessage(jobprofileData, item.GetType().Name, eventAction.ToString()); }