Defines custom message conventions instead of using the IMessage, IEvent or ICommand interfaces, and other conventions.
Inheritance: ExposeSettings
Example #1
0
        /// <summary>
        /// Initializes the endpoint configuration builder.
        /// </summary>
        /// <param name="endpointName">The name of the endpoint being configured.</param>
        public EndpointConfiguration(string endpointName)
            : base(new SettingsHolder())
        {
            ValidateEndpointName(endpointName);

            Settings.Set("NServiceBus.Routing.EndpointName", endpointName);

            Settings.SetDefault("Endpoint.SendOnly", false);
            Settings.SetDefault("Transactions.IsolationLevel", IsolationLevel.ReadCommitted);
            Settings.SetDefault("Transactions.DefaultTimeout", TransactionManager.DefaultTimeout);

            Settings.Set(new AssemblyScanningComponent.Configuration(Settings));
            Settings.Set(new InstallationComponent.Configuration(Settings));
            Settings.Set(new HostingComponent.Settings(Settings));
            Settings.Set(new TransportComponent.Settings(Settings));
            Settings.Set(new RoutingComponent.Configuration(Settings));
            Settings.Set(new ReceiveComponent.Configuration(Settings));
            Settings.Set(new RecoverabilityComponent.Configuration());
            Settings.Set(Pipeline = new PipelineSettings(Settings));

            Notifications = new Notifications();
            Settings.Set(Notifications);

            ConventionsBuilder = new ConventionsBuilder(Settings);
        }
        /// <summary>
        /// Initializes the endpoint configuration builder.
        /// </summary>
        /// <param name="endpointName">The name of the endpoint being configured.</param>
        public EndpointConfiguration(string endpointName)
            : base(new SettingsHolder())
        {
            ValidateEndpointName(endpointName);

            Settings.Set <StartupDiagnosticEntries>(new StartupDiagnosticEntries());

            Settings.Set("NServiceBus.Routing.EndpointName", endpointName);

            pipelineCollection = new PipelineConfiguration();
            Settings.Set <PipelineConfiguration>(pipelineCollection);
            Pipeline = new PipelineSettings(pipelineCollection.Modifications, Settings);

            Settings.Set <QueueBindings>(new QueueBindings());

            Settings.SetDefault("Endpoint.SendOnly", false);
            Settings.SetDefault("Transactions.IsolationLevel", IsolationLevel.ReadCommitted);
            Settings.SetDefault("Transactions.DefaultTimeout", TransactionManager.DefaultTimeout);

            Notifications = new Notifications();
            Settings.Set <Notifications>(Notifications);
            Settings.Set <NotificationSubscriptions>(new NotificationSubscriptions());

            conventionsBuilder = new ConventionsBuilder(Settings);
        }
 public static void Init(ConventionsBuilder conventionsBuilder)
 {
     conventionsBuilder
         .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("Commands"))
         .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("Events"))
         .DefiningMessagesAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("RequestResponse"))
         .DefiningEncryptedPropertiesAs(p => p.Name.StartsWith("Encrypted"));
 }
        /// <summary>
        /// Sets the function to be used to evaluate whether a message has a time to be received.
        /// </summary>
        public static ConventionsBuilder DefiningTimeToBeReceivedAs(this ConventionsBuilder builder, Func <Type, TimeSpan> retrieveTimeToBeReceived)
        {
            Guard.AgainstNull(nameof(builder), builder);
            Guard.AgainstNull(nameof(retrieveTimeToBeReceived), retrieveTimeToBeReceived);

            builder.Settings.Set(new UserDefinedTimeToBeReceivedConvention(retrieveTimeToBeReceived));

            return(builder);
        }
        /// <summary>
        /// Sets the function to be used to evaluate whether a type is an express message or not.
        /// </summary>
        public static ConventionsBuilder DefiningExpressMessagesAs(this ConventionsBuilder builder, Func <Type, bool> definesExpressMessageType)
        {
            Guard.AgainstNull(nameof(builder), builder);
            Guard.AgainstNull(nameof(definesExpressMessageType), definesExpressMessageType);

            builder.Settings.Set("messageDurabilityConvention", definesExpressMessageType);

            return(builder);
        }
Example #6
0
 public static ConventionsBuilder DefiningExpressMessagesAs(this ConventionsBuilder builder, Func <Type, bool> definesExpressMessageType)
 {
     throw new NotImplementedException();
 }