コード例 #1
0
ファイル: ReceiverApp.cs プロジェクト: hannanmumtaz/jasper
        public ReceiverApp()
        {
            Configuration
            .AddJsonFile("appsettings.json")
            .AddEnvironmentVariables();

            Hosting.UseUrls("http://*:5061").UseKestrel();

            Hosting.ConfigureLogging(x =>
            {
                //x.AddConsole();
                x.SetMinimumLevel(LogLevel.Information);
            });

            Settings.ConfigureMarten((config, options) =>
            {
                options.PLV8Enabled             = false;
                options.AutoCreateSchemaObjects = AutoCreate.None;
                options.Connection(config.Configuration["marten"]);
                options.DatabaseSchemaName = "receiver";
                options.Schema.For <SentTrack>();
                options.Schema.For <ReceivedTrack>();
            });

            Include <MartenBackedPersistence>();



            Settings.Configure(c =>
            {
                Transports.ListenForMessagesFrom(c.Configuration["listener"]);
            });
        }
コード例 #2
0
ファイル: SenderApp.cs プロジェクト: tmpreston/jasper
        public SenderApp()
        {
            Configuration.AddJsonFile("appsettings.json").AddEnvironmentVariables();

            Hosting.UseUrls("http://*:5060").UseKestrel();

            Hosting.ConfigureLogging(x =>
            {
                x.SetMinimumLevel(LogLevel.Error);
                x.AddConsole();
            });

            Settings.Alter <MessagingSettings>(x => x.NodeReassignmentPollingTime = 5.Seconds());

            Settings.PersistMessagesWithSqlServer((context, settings) =>
            {
                settings.ConnectionString = context.Configuration["mssql"];
                settings.SchemaName       = "sender";
            });


            Settings.Configure(c =>
            {
                Transports.ListenForMessagesFrom(c.Configuration["listener"]);
                Publish.AllMessagesTo(c.Configuration["receiver"]);
            });
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: tmpreston/jasper
        public SubscriberApp()
        {
            Hosting.UseUrls("http://localhost:5004");
            Transports.Http.EnableListening(true);
            Subscribe.At("http://loadbalancer/messages");
            Subscribe.ToAllMessages();

            Transports.LightweightListenerAt(22222);
        }
コード例 #4
0
        public AppUsingHttpTransport()
        {
            // While *sending* by the HTTP transport is enabled by default,
            // you have to explicitly enable the HTTP transport listening
            Transports.Http.EnableListening(true)

            // The default is 10 seconds
            .ConnectionTimeout(2.Seconds())

            // Override the releative Url of the message
            // listening routes. The default is _messages
            .RelativeUrl("_jasper");

            // You'll have to have Kestrel or some other
            // web server for this to function
            Hosting
            .UseUrls("http://*:5000")
            .UseKestrel();
        }
コード例 #5
0
ファイル: ReceiverApp.cs プロジェクト: tmpreston/jasper
        public ReceiverApp()
        {
            Configuration.AddJsonFile("appsettings.json").AddEnvironmentVariables();

            Hosting.UseUrls("http://*:5061").UseKestrel();

            Hosting.ConfigureLogging(x =>
            {
                x.SetMinimumLevel(LogLevel.Information);
                x.AddConsole();
            });

            Settings.PersistMessagesWithSqlServer((context, settings) =>
            {
                settings.SchemaName       = "receiver";
                settings.ConnectionString = context.Configuration["mssql"];
            });


            Settings.Configure(c =>
            {
                Transports.ListenForMessagesFrom(c.Configuration["listener"]);
            });
        }
コード例 #6
0
        public SubscriberApp()
        {
            Hosting.UseUrls("http://localhost:5004");

            Transports.LightweightListenerAt(22222);
        }