internal virtual AggregateConsumingResult Reply(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, IFallbackStrategy fallbackStrategy) { Message.Acknowledge(inboundChannel); return this; }
void IChannelManagement.DeleteChannel(string id) { if (string.IsNullOrEmpty(id)) { throw new ArgumentNullException("id"); } IOutboundChannel chan = null; foreach (IOutboundChannel ch in _target.OutboundChannels) { if (ch.ID == id) { chan = ch; break; } } if (chan != null) { if (chan.SubscribedClients > 0) { throw new InvalidOperationException( "Unable to delete channels to which there are still subscribed clients"); } chan.Stop(); _target.OutboundChannels.Remove(chan); } else { throw new LogbusException(string.Format("Channel {0} not found", id)); } }
internal override AggregateConsumingResult Reply(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, IFallbackStrategy fallbackStrategy) { Message.Requeue(inboundChannel); return(this); }
internal override AggregateConsumingResult Reply(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, IFallbackStrategy fallbackStrategy) { fallbackStrategy.Apply(outboundChannel, Message); return(base.Reply(inboundChannel, outboundChannel, fallbackStrategy)); }
internal virtual IOutboundChannel CreateIOutboundChannel() { // TODO: creare l'istanza di una classe concreta appropriata. IOutboundChannel target = ((IOutboundChannelFactory) new SimpleOutChannelFactory()).CreateChannel("dummy", "Channel for tests", new TrueFilter()); return(target); }
public void StartTest() { IOutboundChannel target = CreateIOutboundChannel(); // TODO: Eseguire l'inizializzazione a un valore appropriato target.Start(); Assert.Inconclusive("Impossibile verificare un metodo che non restituisce valori."); }
internal virtual AggregateConsumingResult Reply(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, IFallbackStrategy fallbackStrategy) { Message.Acknowledge(inboundChannel); return(this); }
ChannelInformation IChannelManagement.GetChannelInformation(string id) { if (string.IsNullOrEmpty(id)) { throw new ArgumentNullException("id"); } IOutboundChannel chan = null; foreach (IOutboundChannel ch in _target.OutboundChannels) { if (ch.ID == id) { chan = ch; break; } } if (chan == null) { return(null); //Really? } return(new ChannelInformation { clients = chan.SubscribedClients.ToString(), coalescenceWindow = (long)chan.CoalescenceWindowMillis, description = chan.Description, filter = chan.Filter as FilterBase, id = chan.ID, title = chan.Name }); }
/// <summary> /// Initializes a new instance of ClientSubscriptionEventArgs /// </summary> /// <param name="channel">Channel to which the client is subscribing</param> /// <param name="transport">Transport chosen by client</param> /// <param name="instructions">Instructions provided by client to the transport</param> protected ClientSubscriptionEventArgs(IOutboundChannel channel, string transport, IEnumerable <KeyValuePair <string, string> > instructions) { Channel = channel; ChosenTransport = transport; TransportConfiguration = instructions; }
internal override AggregateConsumingResult Reply(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, IFallbackStrategy fallbackStrategy) { Message.Requeue(inboundChannel); return this; }
public FakeConsumerBase(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, Queue queue, IConsumedMessageBuilder builder, ConsumingConfiguration configuration) : base(inboundChannel, outboundChannel, queue, builder, configuration) { }
/// <remarks/> public OutChannelCreationEventArgs(IOutboundChannel channel) { if (channel == null) { throw new ArgumentNullException("channel"); } Channel = channel; }
public void UnsubscribeClientTest() { IOutboundChannel target = CreateIOutboundChannel(); // TODO: Eseguire l'inizializzazione a un valore appropriato string clientId = string.Empty; // TODO: Eseguire l'inizializzazione a un valore appropriato target.UnsubscribeClient(clientId); Assert.Inconclusive("Impossibile verificare un metodo che non restituisce valori."); }
public void SubscribedClientsTest() { IOutboundChannel target = CreateIOutboundChannel(); // TODO: Eseguire l'inizializzazione a un valore appropriato int actual; actual = target.SubscribedClients; Assert.Inconclusive("Verificare la correttezza del metodo di test."); }
public void TransportFactoryHelperTest() { IOutboundChannel target = CreateIOutboundChannel(); // TODO: Eseguire l'inizializzazione a un valore appropriato ITransportFactoryHelper expected = null; // TODO: Eseguire l'inizializzazione a un valore appropriato target.TransportFactoryHelper = expected; Assert.Inconclusive("Impossibile verificare proprietà in sola scrittura."); }
/// <summary> /// Initializes a new instance of ClientSubscribedEventArgs /// </summary> /// <param name="channel">Channel to which the client is subscribing</param> /// <param name="transport">Transport chosen by client</param> /// <param name="instructions">Instructions provided by client to the transport</param> /// <param name="clientId">Client ID assigned by Logbus-ng</param> /// <param name="outInstructions">Instructions provided by transport to client</param> public ClientSubscribedEventArgs(IOutboundChannel channel, string transport, IEnumerable <KeyValuePair <string, string> > instructions, string clientId, IDictionary <string, string> outInstructions) : base(channel, transport, instructions) { ClientId = clientId; ClientInstructions = outInstructions; }
internal AtMostOnceConsumerWrapper(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, Queue queue, IConsumedMessageBuilder builder, ConsumingConfiguration configuration) : base(inboundChannel, outboundChannel, queue, builder, configuration) { }
internal override ConsumerBase BuildConsumer(IInboundChannel inboundChannel, IOutboundChannel outboundChannel) { return new LoggedAtLeastOnceConsumer(inboundChannel, outboundChannel, Queue, Builder, Configuration, LogBuilder()); }
internal override ConsumerBase BuildConsumer(IInboundChannel inboundChannel, IOutboundChannel outboundChannel) { return(new LoggedAtLeastOnceConsumer(inboundChannel, outboundChannel, Queue, Builder, Configuration, LogBuilder())); }
internal LoggedAtLeastOnceConsumer(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, Queue queue, IConsumedMessageBuilder builder, ConsumingConfiguration configuration, ILog log) : base(inboundChannel, outboundChannel, queue, builder, configuration) { _log = log; }
internal Connection(RabbitMQ.Client.IConnection connection, IEnumerable <ConsumerBase> consumers, IOutboundChannel outboundChannel, EnvironmentConfiguration configuration) { _connection = connection; _consumers = consumers; _outboundChannel = outboundChannel; Configuration = configuration; }
internal LoggedAtMostOnceConsumer(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, Queue queue, IConsumedMessageBuilder builder, ConsumingConfiguration configuration, ILog log) : base(inboundChannel, outboundChannel, queue, builder, configuration) { _log = log; }
protected internal ConsumerBase(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, Queue queue, IConsumedMessageBuilder builder, ConsumingConfiguration configuration) { InboundChannel = inboundChannel; OutboundChannel = outboundChannel; _queue = queue; _builder = builder; Configuration = configuration; ConsumerCancelled += OnConsumerCancelled; }
public void SubscribeClientTest() { IOutboundChannel target = CreateIOutboundChannel(); // TODO: Eseguire l'inizializzazione a un valore appropriato string transportId = string.Empty; // TODO: Eseguire l'inizializzazione a un valore appropriato IEnumerable <KeyValuePair <string, string> > inputInstructions = null; // TODO: Eseguire l'inizializzazione a un valore appropriato IEnumerable <KeyValuePair <string, string> > outputInstructions = null; // TODO: Eseguire l'inizializzazione a un valore appropriato IEnumerable <KeyValuePair <string, string> > outputInstructionsExpected = null; // TODO: Eseguire l'inizializzazione a un valore appropriato string expected = string.Empty; // TODO: Eseguire l'inizializzazione a un valore appropriato string actual; actual = target.SubscribeClient(transportId, inputInstructions, out outputInstructions); Assert.AreEqual(outputInstructionsExpected, outputInstructions); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verificare la correttezza del metodo di test."); }
protected virtual void ConnectToBroker() { if (_outboundModel != null && !_outboundModel.IsClosed) return; _connection = _connectionBuilder.CreateConnection(_configuration.EndpointUri); //Logger.DebugFormat("RMQMessagingGateway: Opening channel to Rabbit MQ on connection {0}", Configuration.AMPQUri.GetSanitizedUri()); _outboundModel = _connection.CreateModel(); //When AutoClose is true, the last channel to close will also cause the connection to close1. If it is set to //true before any channel is created, the connection will close then and there. if (_connection.AutoClose == false) _connection.AutoClose = true; foreach (var exchange in _exchanges) exchange.Declare(_outboundModel); foreach (var queue in _queues) queue.Declare(_outboundModel); foreach (var binding in _bindings) binding.Declare(_outboundModel); var builder = new ConsumedMessageBuilder(_configuration.SerializationConfiguration, _configuration.MessageTypeResolver); _outboundChannel = _configuration.OutboundChannelBuilder(_outboundModel, _configuration); var consumers = _promises.Select(_ => { var model = CreateInboundModel(_connection, _configuration.PrefetchSize, _configuration.PrefetchCount); var consumer = _(builder).BuildConsumer(new InboundChannel(model), _outboundChannel); return new {Model = model, Consumer = consumer}; }) .ToList(); foreach (var consumer in consumers) consumer.Consumer.Declare(consumer.Model); _consumers = consumers.Select(_ => _.Consumer); }
internal abstract ConsumerBase BuildConsumer(IInboundChannel inboundChannel, IOutboundChannel outboundChannel);
/// <summary> /// Required by ILogBus /// </summary> public void AddOutboundChannel(IOutboundChannel channel) { _target.AddOutboundChannel(channel); }
/// <summary> /// Initializes a new instance of ClientUnsubscribedEventArgs /// </summary> /// <param name="channel">Channel to which the client was subscribed</param> /// <param name="clientId">ID of client</param> public ClientUnsubscribedEventArgs(IOutboundChannel channel, string clientId) { Channel = channel; ClientId = clientId; }
public void Apply(IOutboundChannel channel, ConsumedMessageBase message) { }
/// <summary> /// Initializes a new instanceClientSubscribingEventArgs /// </summary> /// <param name="channel">Channel to which the client is subscribing</param> /// <param name="transport">Transport chosen by client</param> /// <param name="instructions">Instructions provided by client to the transport</param> public ClientSubscribingEventArgs(IOutboundChannel channel, string transport, IEnumerable <KeyValuePair <string, string> > instructions) : base(channel, transport, instructions) { }
public void Apply(IOutboundChannel channel, ConsumedMessageBase message) { channel.ForwardAsync(message, _exchange, String.Empty); }
internal override AggregateConsumingResult Reply(IInboundChannel inboundChannel, IOutboundChannel outboundChannel, IFallbackStrategy fallbackStrategy) { fallbackStrategy.Apply(outboundChannel, Message); return base.Reply(inboundChannel, outboundChannel, fallbackStrategy); }