예제 #1
0
        public ReceiveEndpointContext CreateReceiveEndpointContext()
        {
            var builder = _host.CreateConsumeTopologyBuilder();

            var queueName = _configuration.InputAddress.AbsolutePath.Split('/').Last();

            builder.Queue = queueName;
            builder.QueueDeclare(queueName);
            builder.Exchange = queueName;
            builder.QueueBind(builder.Exchange, builder.Queue);

            _configuration.Topology.Consume.Apply(builder);

            return(new InMemoryReceiveEndpointContext(_configuration, _host, ReceiveObservers, TransportObservers, EndpointObservers));
        }
        public IInMemoryReceiveEndpointTopology CreateReceiveEndpointTopology(Uri inputAddress)
        {
            var builder = _host.CreateConsumeTopologyBuilder();

            var queueName = inputAddress.AbsolutePath.Split('/').Last();

            builder.Queue = queueName;
            builder.QueueDeclare(queueName);
            builder.Exchange = queueName;
            builder.QueueBind(builder.Exchange, builder.Queue);

            _configuration.Topology.Consume.Apply(builder);

            return(new InMemoryReceiveEndpointTopology(_configuration, inputAddress, MessageSerializer, _sendTransportProvider));
        }