Example #1
0
        public StaticRoutingApp(AppSettings settings)
        {
            // Explicitly add a single message type
            Publish.Message <PingMessage>()
            .To(settings.Transactions);

            // Publish any message type contained in the assembly
            // to this channel, by supplying a type contained
            // within that assembly
            Publish.MessagesFromAssemblyContaining <PingMessage>()
            .To(settings.Transactions);

            // Publish any message type contained in the named
            // assembly to this channel
            Publish.MessagesFromAssembly(Assembly.Load(new AssemblyName("MyMessageLibrary")))
            .To(settings.Transactions);

            // Publish any message type contained in the
            // namespace given to this channel
            Publish.MessagesFromNamespace("MyMessageLibrary")
            .To(settings.Transactions);

            // Publish any message type contained in the namespace
            // of the type to this channel
            Publish.MessagesFromNamespaceContaining <PingMessage>()
            .To(settings.Transactions);
        }
        public StatusMessageSendingApp()
        {
            // Any time StatusMessage is published,
            // set the deliver within limit on the outgoing Envelope
            Publish.Message <StatusMessage>()
            .Customize(envelope => envelope.DeliverWithin(10.Seconds()));

            // Use a criteria against the message type to say
            // that all messages contained in the "MyApp.Status" namespace
            // would be published with the deliver within rule
            Publish.MessagesFromNamespace("MyApp.Status")
            .Customize(envelope => envelope.DeliverWithin(10.Seconds()));
        }