private void _setReplyTo(IEndpoint commandEndpoint, IIntegrationCommand command, MessageMetaData commandMeta) { if (commandMeta == null) { throw new InvalidOperationException("Command cannot be sent. Unable to set replyTo on null MessageMetaData"); } if (!String.IsNullOrEmpty(commandMeta.ReplyTo)) { return; } if (!String.IsNullOrEmpty(commandMeta.ReplyToEndpointName)) { var replyToEndpoint = MessagingMap.FindEndpointByName(commandMeta.ReplyToEndpointName); replyToEndpoint.SetReplyToForCommand(command, commandMeta); return; } else if (MessagingMap.DefaultReplyToEndpoint != null) { MessagingMap.DefaultReplyToEndpoint.SetReplyToForCommand(command, commandMeta); return; } throw new InvalidOperationException("Command cannot be sent because replyTo endpoint could not be determined"); }
public Task SendSynchronously(IIntegrationCommand command, MessageMetaData metaData = null) { metaData = metaData ?? new MessageMetaData(); var endpoint = MessagingMap.FindEndpoint(command); _setReplyTo(endpoint, command, metaData); return(Dispatch(command, metaData)); }
/************ Message Dispatching ***********/ public Task Send(IIntegrationCommand command, IOutboxSession outbox, MessageMetaData metaData = null) { metaData = metaData ?? new MessageMetaData(); var endpoint = MessagingMap.FindEndpoint(command); _setReplyTo(endpoint, command, metaData); return(Dispatch(command, metaData, outbox)); }
public void SetReplyToForCommand(IEndpoint endpoint, IIntegrationCommand command, MessageMetaData meta) { meta = meta ?? new MessageMetaData(); if (!_replyToRouteCache.ContainsKey(endpoint.Name)) { _replyToRouteCache[endpoint.Name] = $"local://endpoint={endpoint.Name}"; } meta.ReplyTo = _replyToRouteCache[endpoint.Name]; }
public static IntegratorUser CreateTestIntegratorUser(this IIntegrationCommand integrationCommand, string loginId, string password, IntegratorPermissions permissions) { var system = new Ats { Name = loginId + " Integration System" }; integrationCommand.CreateIntegrationSystem(system); var user = new IntegratorUser { LoginId = loginId, PasswordHash = HashToString(password), Permissions = permissions, IntegrationSystemId = system.Id }; integrationCommand.CreateIntegratorUser(user); return(user); }
public void SetReplyToForCommand(IEndpoint endpoint, IIntegrationCommand command, MessageMetaData meta) { meta = meta ?? new MessageMetaData(); //if (meta == null) // throw new InvalidOperationException("Cannot set reply to on null MessageMetaData"); if (!_replyToRouteCache.ContainsKey(endpoint.Name)) { var connBuilder = new ServiceBusConnectionStringBuilder(endpoint.Settings.ConnectionString); string sbEndpoint = connBuilder.Endpoint; string sbEntityPath = connBuilder.EntityPath; if (!String.IsNullOrEmpty(sbEndpoint) && !String.IsNullOrEmpty(sbEntityPath)) { _replyToRouteCache[endpoint.Name] = $"Endpoint={sbEndpoint};EntityPath={sbEntityPath}"; } } meta.ReplyTo = _replyToRouteCache[endpoint.Name]; }
public IEndpoint FindEndpointForReply(MessageContext commandContext) => null; // Endpoint; public void SetReplyToForCommand(IEndpoint endpoint, IIntegrationCommand command, MessageMetaData meta) => meta.ReplyTo = null; //this.Endpoint.Name;
public void SetReplyToForCommand(IIntegrationCommand command, MessageMetaData meta) { throw new NotImplementedException(); }
public static IntegratorUser CreateTestIntegratorUser(this IIntegrationCommand integrationCommand) { return(integrationCommand.CreateTestIntegratorUser(UserName, Password, IntegratorPermissions.GetJobAds | IntegratorPermissions.GetJobApplication | IntegratorPermissions.PostJobAds)); }
/// <summary> /// Send command using the configured outbox /// </summary> /// <param name="command"></param> /// <param name="metaData"></param> /// <returns></returns> public Task Send(IIntegrationCommand command, MessageMetaData metaData = null) { return(_messagingService.Send(command, _outbox, metaData)); }
/// <summary> /// Send Command skipping the outbox, the outbound message filter pipeline will still be honored /// </summary> /// <param name="command"></param> /// <param name="options"></param> /// <returns></returns> public Task SendSynchronously(IIntegrationCommand command, MessageMetaData options = null) { return(_messagingService.SendSynchronously(command, options)); }
public virtual void SetReplyToForCommand(IIntegrationCommand command, MessageMetaData meta) { Transport.SetReplyToForCommand(this, command, meta); }