Example #1
0
        public SenderApp()
        {
            Configuration.AddJsonFile("appsettings.json").AddEnvironmentVariables();

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

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

            Settings.ConfigureMarten((config, options) =>
            {
                options.AutoCreateSchemaObjects = AutoCreate.None;
                options.Connection(config.Configuration["marten"]);
                options.DatabaseSchemaName = "sender";
                options.PLV8Enabled        = false;

                options.Schema.For <SentTrack>();
                options.Schema.For <ReceivedTrack>();
            });

            Include <MartenBackedPersistence>();

            Settings.Configure(c =>
            {
                Transports.ListenForMessagesFrom(c.Configuration["listener"]);
                Publish.AllMessagesTo(c.Configuration["receiver"]);
            });
        }
Example #2
0
        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"]);
            });
        }
        public HttpTransportUsingApp()
        {
            Publish.AllMessagesTo("http://server1/messages");

            // Or

            Publish.AllMessagesTo("http://server1/messages/durable");
        }
Example #4
0
        public HardCodedConnectionApp()
        {
            Settings
            .AddAzureServiceBusConnection("azure", "some connection string");

            Publish.AllMessagesTo("azureservicebus://azure/queue/outgoing");

            Transports.ListenForMessagesFrom("azureservicebus://azure/queue/incoming");
        }
Example #5
0
        public HardCodedConnectionApp()
        {
            // This adds a connection string to the host "rabbitserver" using
            // the default port
            Settings
            .AddRabbitMqHost("rabbitserver");

            Publish.AllMessagesTo("rabbitmq://rabbitserver/queue/outgoing");

            Transports.ListenForMessagesFrom("rabbitmq://rabbitserver/queue/incoming");
        }
        public DurableSender(bool latched)
        {
            HttpRoutes.Enabled = false;

            Publish.AllMessagesTo("loopback://durable/one");

            Settings.PersistMessagesWithMarten(Servers.PostgresConnectionString);

            Settings.Alter <ReceivingSettings>(x => x.Latched = latched);

            Services.AddSingleton <MessageTracker>();
        }
Example #7
0
        public MessageSpecificTopicRoutingApp()
        {
            // Publish all messages to Rabbit Mq using the configured connection
            // string named 'rabbit' and use the message type name as the published
            // topic name
            Publish.AllMessagesTo("rabbitmq://rabbit/topic/*");


            // Make a subscription to all topic names that match known, handled message types
            // in this application using the configured connection string 'rabbit'.
            Transports.ListenForMessagesFrom("rabbitmq://rabbit/topic/*");
        }
Example #8
0
        public JasperConfig()
        {
            Include <MartenBackedPersistence>();

            Settings.ConfigureMarten((context, marten) =>
            {
                marten.Connection(context.Configuration.GetConnectionString("my_conn_str"));
            });

            Transports.DurableListenerAt(8567);
            Publish.AllMessagesTo("tcp://localhost:8568");
        }
Example #9
0
        public MessageSpecificTopicRoutingApp()
        {
            // Publish all messages to Azure Service Bus using the configured connection
            // string named 'azure' and use the message type name as the published
            // topic name
            Publish.AllMessagesTo("azureservicebus://azure/topic/*");


            // Make a subscription to all topic names that match known, handled message types
            // in this application using the configured connection string 'azure' and the subscription
            // 'appname'
            Transports.ListenForMessagesFrom("azureservicebus://azure/subscription/appname/topic/*");
        }
Example #10
0
        public ASBUsingApp()
        {
            HttpRoutes.DisableConventionalDiscovery();

            Transports.ListenForMessagesFrom("azureservicebus://jasper/queue/messages");

            Services.AddSingleton <ColorHistory>();
            Services.AddSingleton <MessageTracker>();

            Publish.AllMessagesTo("azureservicebus://jasper/queue/messages");

            Include <MessageTrackingExtension>();
        }
Example #11
0
        public OutboxSampleApp()
        {
            Include <MartenBackedPersistence>();

            Settings.Alter <StoreOptions>(_ =>
            {
                _.Connection("Host=localhost;Port=5432;Database=postgres;Username=postgres;password=postgres");
            });

            Publish.Message <UserCreated>();
            Publish.Message <UserDeleted>();
            Publish.AllMessagesTo("tcp://localhost:22222/durable");
        }
Example #12
0
        public RabbitMqUsingApp()
        {
            Settings.AddRabbitMqHost("localhost");

            HttpRoutes.DisableConventionalDiscovery();

            Transports.ListenForMessagesFrom("rabbitmq://localhost/queue/messages3");

            Services.AddSingleton <ColorHistory>();
            Services.AddSingleton <MessageTracker>();

            Publish.AllMessagesTo("rabbitmq://localhost/queue/messages3");

            Include <MessageTrackingExtension>();
        }
Example #13
0
        public RabbitSender()
        {
            Handlers.DisableConventionalDiscovery();

            Hosting.ConfigureLogging(x =>
            {
                x.AddConsole();
                x.AddDebug();
            });

            Publish.AllMessagesTo("rabbitmq://localhost:5672/numbers");

            Settings.PersistMessagesWithSqlServer(Servers.SqlServerConnectionString, "rabbit_sender");

            Services.AddSingleton <IHostedService, TimedSender>();
        }
Example #14
0
        public RabbitMqUsingApp()
        {
            Hosting.ConfigureLogging(x =>
            {
                x.AddConsole();
                x.AddDebug();
            });

            Transports.ListenForMessagesFrom("rabbitmq://localhost:5672/messages3");

            Services.AddSingleton <ColorHistory>();
            Services.AddSingleton <MessageTracker>();

            Publish.AllMessagesTo("rabbitmq://localhost:5672/messages3");

            Include <MessageTrackingExtension>();
        }
Example #15
0
        public RabbitMqUsingApp2()
        {
            Settings.AddRabbitMqHost("localhost");

            Settings.Alter <RabbitMqOptions>(settings =>
            {
                settings.Connections.Add("messages3", "host=localhost");
                settings.Connections.Add("replies", "host=localhost");
            });

            Transports.ListenForMessagesFrom("rabbitmq://messages3/queue/messages3");

            Services.AddSingleton <ColorHistory>();
            Services.AddSingleton <MessageTracker>();

            Publish.AllMessagesTo("rabbitmq://messages3/queue/messages3");

            Include <MessageTrackingExtension>();
        }
Example #16
0
        public SenderApp()
        {
            Hosting(builder =>
            {
                builder.UseUrls("http://*:5060").UseKestrel();
            });



            Settings.Alter <JasperOptions>(x => x.Retries.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"]);
            });
        }
Example #17
0
 public AppPublishingToRabbitMQ()
 {
     Publish.AllMessagesTo("rabbitmq://rabbitserver:5672/messages");
 }