Exemplo n.º 1
0
        public void Send()
        {
            var state = new State();

            using (var bus = StartBus(state))
            {
                var message = @"{ Property: 'Value' }";

                var headers = new Dictionary <string, string>
                {
                    { "NServiceBus.EnclosedMessageTypes", typeof(MessageToSend).FullName }
                };

                NativeSend.SendMessage(connectionString, endpointName, message, headers);
                state.ResetEvent.WaitOne();
            }
        }
Exemplo n.º 2
0
        public async Task Send()
        {
            var state = new State();

            using (var bus = StartBus(state))
            {
                var message = @"{ Property: 'Value' }";

                var headers = new Dictionary <string, string>
                {
                    { "NServiceBus.EnclosedMessageTypes", "NativeSendTests+MessageToSend" }
                };

                await NativeSend.SendMessage(connectionString, endpointName, message, headers)
                .ConfigureAwait(false);

                state.ResetEvent.WaitOne();
            }
        }