Пример #1
0
 public SatelliteDefinition(string name, string receiveAddress, PushRuntimeSettings runtimeSettings, Func <RecoverabilityConfig, ErrorContext, RecoverabilityAction> recoverabilityPolicy, OnSatelliteMessage onMessage)
 {
     Name                 = name;
     ReceiveAddress       = receiveAddress;
     RuntimeSettings      = runtimeSettings;
     RecoverabilityPolicy = recoverabilityPolicy;
     OnMessage            = onMessage;
 }
        /// <summary>
        /// Adds a new satellite receiver.
        /// </summary>
        /// <param name="name">Name of the satellite.</param>
        /// <param name="transportAddress">The autogenerated transport address to listen on.</param>
        /// <param name="runtimeSettings">Transport runtime settings.</param>
        /// <param name="recoverabilityPolicy">Recoverability policy to be if processing fails.</param>
        /// <param name="onMessage">The message func.</param>
        public void AddSatelliteReceiver(string name, string transportAddress, PushRuntimeSettings runtimeSettings, Func <RecoverabilityConfig, ErrorContext, RecoverabilityAction> recoverabilityPolicy, OnSatelliteMessage onMessage)
        {
            Guard.AgainstNullAndEmpty(nameof(name), name);
            Guard.AgainstNullAndEmpty(nameof(transportAddress), transportAddress);
            Guard.AgainstNull(nameof(runtimeSettings), runtimeSettings);
            Guard.AgainstNull(nameof(recoverabilityPolicy), recoverabilityPolicy);
            Guard.AgainstNull(nameof(onMessage), onMessage);

            Receiving.AddSatelliteReceiver(name, transportAddress, runtimeSettings, recoverabilityPolicy, onMessage);
        }
            public void AddSatelliteReceiver(string name, string transportAddress, PushRuntimeSettings runtimeSettings, Func <RecoverabilityConfig, ErrorContext, RecoverabilityAction> recoverabilityPolicy, OnSatelliteMessage onMessage)
            {
                var satelliteDefinition = new SatelliteDefinition(name, transportAddress, runtimeSettings, recoverabilityPolicy, onMessage);

                satelliteDefinitions.Add(satelliteDefinition);
            }