private NmsConsumer(INmsConnection connection, Destination destination, string selector) { this.id = idCounter++; this.selector = selector; this.destination = destination; this.connection = connection; this.connection.ConnectionInterrupted += new EventHandler<NmsConnectionEventArgs>(connection_ConnectionInterrupted); this.connection.ConnectionResumed += new EventHandler<NmsConnectionEventArgs>(connection_ConnectionResumed); }
internal NmsMultiConsumer(INmsConnection connection, Destination destination, int consumerCount, Func<MessageFactory, IMessage, IMessage> messageReceivedCallback, string selector = null) : this() { for (int i = 0; i < consumerCount; i++) { log.Debug("[{2}] Creating consumer #{0} to destination {1}", i, destination, connection.ID); var consumer = new NmsConsumer(connection, destination, messageReceivedCallback, selector); this.consumers.Add(consumer); } }
public NmsProducer CreateSynchronousProducer(Destination destination) { return new NmsProducer(this, destination, synchronous: true); }
public NmsProducer CreateProducer(Destination destination, MsgDeliveryMode messageDeliveryMode) { return new NmsProducer(this, destination, deliveryMode: messageDeliveryMode); }
public NmsProducer CreateProducer(Destination destination) { return new NmsProducer(this, destination); }
public void SendRequest(Destination destination, IMessage message, MsgDeliveryMode deliveryMode, MsgPriority messagePriority, TimeSpan timeToLive) { if (!this.isInitialized) this.asr.WaitOne(10000); this.producer.Send(destination.GetDestination(this.session), message, deliveryMode, messagePriority, timeToLive); }
NmsProducer INmsConnection.CreateSynchronousProducer(Destination destination) { return this.GetConnection().CreateProducer(destination, synchronous: true); }
NmsProducer INmsConnection.CreateProducer(Destination destination) { return new NmsProducer(this, destination); }
NmsConsumer INmsConnection.CreateConsumer(Destination destination, Func<MessageFactory, IMessage, IMessage> messageReceivedCallback) { return new NmsConsumer(this, destination, messageReceivedCallback); }
internal NmsConsumer(INmsConnection connection, Destination destination, Func<MessageFactory, IMessage, IMessage> messageReceivedCallback, string selector = null) : this(connection, destination, selector) { this.requestReplyCallback = messageReceivedCallback; this.SetupRequestReply(connection, destination, messageReceivedCallback, selector); }
private void SetupRequestReply(INmsConnection connection, Destination destination, Func<MessageFactory, IMessage, IMessage> messageReceivedCallback, string selector = null) { this.session = connection.GetSession(); this.consumer = (selector == null) ? this.session.CreateConsumer(destination.GetDestination(this.session)) : session.CreateConsumer(destination.GetDestination(this.session), selector); this.consumer.Listener += new MessageListener(this.RequestReplyCallback); this.replyProducer = this.session.CreateProducer(); this.replyProducer.DeliveryMode = MsgDeliveryMode.NonPersistent; this.isInitialized = true; }
private void SetupRequestOnly(INmsConnection connection, Destination destination, Action<IMessage> messageReceivedCallback, string selector = null) { this.session = connection.GetSession(); this.consumer = (selector == null) ? this.session.CreateConsumer(destination.GetDestination(this.session)) : session.CreateConsumer(destination.GetDestination(this.session), selector); this.consumer.Listener += new MessageListener(this.RequestOnlyCallback); this.isInitialized = true; }
internal NmsProducer(INmsConnection connection, Destination destination, MsgDeliveryMode deliveryMode = MsgDeliveryMode.Persistent, bool synchronous = false) : this() { this.innerDestination = destination; this.Setup(connection, deliveryMode, synchronous); }
public NmsProducer CreateSynchronousProducer(Destination destination, MsgDeliveryMode messageDeliveryMode) { return new NmsProducer(this, destination, deliveryMode: messageDeliveryMode, synchronous: true); }
public NmsConsumer CreateConsumer(Destination destination, Action<IMessage> messageReceivedCallback, string selector = null) { return new NmsConsumer(this, destination, messageReceivedCallback, selector); }
NmsConsumer INmsConnection.CreateConsumer(Destination destination, Action<IMessage> messageReceivedCallback) { return new NmsConsumer(this, destination, messageReceivedCallback); }
public NmsMultiConsumer CreateMultiConsumer(Destination destination, int consumerCount, Func<MessageFactory, IMessage, IMessage> messageReceivedCallback, string selector = null) { return new NmsMultiConsumer(this, destination, consumerCount, messageReceivedCallback, selector); }
NmsMultiConsumer INmsConnection.CreateMultiConsumer(Destination destination, int consumerCount, Func<MessageFactory, IMessage, IMessage> messageReceivedCallback) { return new NmsMultiConsumer(this, destination, consumerCount, messageReceivedCallback); }
public NmsMultiConsumer CreateMultiConsumer(Destination destination, int consumerCount, Action<IMessage> messageReceivedCallback) { return new NmsMultiConsumer(this, destination, consumerCount, messageReceivedCallback); }
NmsProducer INmsConnection.CreateProducer(Destination destination, MsgDeliveryMode messageDeliveryMode) { return new NmsProducer(this, destination, messageDeliveryMode); }
public NmsProducer CreateProducer(Destination destination, MsgDeliveryMode messageDeliveryMode = MsgDeliveryMode.Persistent, bool synchronous = false) { return new NmsProducer(this, destination, messageDeliveryMode, synchronous); }
NmsProducer INmsConnection.CreateSynchronousProducer(Destination destination, MsgDeliveryMode messageDeliveryMode) { return this.GetConnection().CreateProducer(destination, messageDeliveryMode: messageDeliveryMode, synchronous: true); }
public void SendRequest(Destination destination, IMessage message) { this.producer.Send(destination.GetDestination(this.session), message); }