コード例 #1
0
        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");
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        /************ 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));
        }
コード例 #4
0
        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];
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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];
        }
コード例 #7
0
 public IEndpoint FindEndpointForReply(MessageContext commandContext) => null;                                                                  // Endpoint;
 public void SetReplyToForCommand(IEndpoint endpoint, IIntegrationCommand command, MessageMetaData meta) => meta.ReplyTo = null;                //this.Endpoint.Name;
コード例 #8
0
 public void SetReplyToForCommand(IIntegrationCommand command, MessageMetaData meta)
 {
     throw new NotImplementedException();
 }
コード例 #9
0
 public static IntegratorUser CreateTestIntegratorUser(this IIntegrationCommand integrationCommand)
 {
     return(integrationCommand.CreateTestIntegratorUser(UserName, Password, IntegratorPermissions.GetJobAds | IntegratorPermissions.GetJobApplication | IntegratorPermissions.PostJobAds));
 }
コード例 #10
0
 /// <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));
 }
コード例 #11
0
 /// <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));
 }
コード例 #12
0
 public virtual void SetReplyToForCommand(IIntegrationCommand command, MessageMetaData meta)
 {
     Transport.SetReplyToForCommand(this, command, meta);
 }