public async Task customize_with_fluent_interface_against_a_specific_type()
        {
            var runtime = await JasperRuntime.ForAsync(_ =>
            {
                _.Publish.Message <MySpecialMessage>().Customize(e => e.Headers.Add("rule", "true"));
            });

            try
            {
                var context = runtime.Get <IMessageContext>();

                // Just to force the message context to pool up the envelope instead
                // of sending it out
                await context.EnlistInTransaction(new InMemoryEnvelopeTransaction());

                var mySpecialMessage = new MySpecialMessage();

                await context.Send("tcp://localhost:2001".ToUri(), mySpecialMessage);

                var outgoing = context.As <MessageContext>().Outstanding.Single();

                outgoing.Headers["rule"].ShouldBe("true");
            }
            finally
            {
                await runtime.Shutdown();
            }
        }
        public async Task see_the_customizations_happen_inside_of_message_context()
        {
            var runtime = await JasperRuntime.BasicAsync();


            try
            {
                var context = runtime.Get <IMessageContext>();

                // Just to force the message context to pool up the envelope instead
                // of sending it out
                await context.EnlistInTransaction(new InMemoryEnvelopeTransaction());

                var mySpecialMessage = new MySpecialMessage();

                await context.Send("tcp://localhost:2001".ToUri(), mySpecialMessage);

                var outgoing = context.As <MessageContext>().Outstanding.Single();

                outgoing.Headers["special"].ShouldBe("true");
            }
            finally
            {
                await runtime.Shutdown();
            }
        }
 public void Handle(MySpecialMessage message)
 {
 }