Ejemplo n.º 1
0
            protected override void ConfigureInMemoryReceiveEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
            {
                string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;

                string messageDataPath = Path.Combine(baseDirectory, "MessageData");

                var dataDirectory = new DirectoryInfo(messageDataPath);

                var fileRepository = new FileSystemMessageDataRepository(dataDirectory);

                ISymmetricKeyProvider keyProvider = new TestSymmetricKeyProvider();
                var cryptoStreamProvider          = new AesCryptoStreamProvider(keyProvider, "default");

                _repository = new EncryptedMessageDataRepository(fileRepository, cryptoStreamProvider);

                configurator.UseMessageData <MessageWithBigData>(_repository);

                _received = Handler <MessageWithBigData>(configurator, async context =>
                {
                    _receivedBody = await context.Message.Body.Value;
                });

                configurator.UseMessageData <MessageWithByteArray>(_repository);

                _receivedBytes = Handler <MessageWithByteArray>(configurator, async context =>
                {
                    _receivedBytesArray = await context.Message.Bytes.Value;
                });
            }
Ejemplo n.º 2
0
            protected override void ConfigureInMemoryBus(IInMemoryBusFactoryConfigurator configurator)
            {
                var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;

                var messageDataPath = Path.Combine(baseDirectory, "MessageData");

                var dataDirectory = new DirectoryInfo(messageDataPath);

                var fileRepository = new FileSystemMessageDataRepository(dataDirectory);

                ISymmetricKeyProvider keyProvider = new TestSymmetricKeyProvider();
                var cryptoStreamProvider          = new AesCryptoStreamProvider(keyProvider, "default");

                _repository = new EncryptedMessageDataRepository(fileRepository, cryptoStreamProvider);

                configurator.UseMessageData(_repository);
            }