Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 public NmsProducer CreateSynchronousProducer(Destination destination)
 {
     return new NmsProducer(this, destination, synchronous: true);
 }
Ejemplo n.º 4
0
 public NmsProducer CreateProducer(Destination destination, MsgDeliveryMode messageDeliveryMode)
 {
     return new NmsProducer(this, destination, deliveryMode: messageDeliveryMode);
 }
Ejemplo n.º 5
0
 public NmsProducer CreateProducer(Destination destination)
 {
     return new NmsProducer(this, destination);
 }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
 NmsProducer INmsConnection.CreateSynchronousProducer(Destination destination)
 {
     return this.GetConnection().CreateProducer(destination, synchronous: true);
 }
Ejemplo n.º 8
0
 NmsProducer INmsConnection.CreateProducer(Destination destination)
 {
     return new NmsProducer(this, destination);
 }
Ejemplo n.º 9
0
 NmsConsumer INmsConnection.CreateConsumer(Destination destination, Func<MessageFactory, IMessage, IMessage> messageReceivedCallback)
 {
     return new NmsConsumer(this, destination, messageReceivedCallback);
 }
Ejemplo n.º 10
0
 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);
 }
Ejemplo n.º 11
0
        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;
        }
Ejemplo n.º 12
0
        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;
        }
Ejemplo n.º 13
0
 internal NmsProducer(INmsConnection connection, Destination destination, MsgDeliveryMode deliveryMode = MsgDeliveryMode.Persistent, bool synchronous = false)
     : this()
 {
     this.innerDestination = destination;
     this.Setup(connection, deliveryMode, synchronous);
 }
Ejemplo n.º 14
0
 public NmsProducer CreateSynchronousProducer(Destination destination, MsgDeliveryMode messageDeliveryMode)
 {
     return new NmsProducer(this, destination, deliveryMode: messageDeliveryMode, synchronous: true);
 }
Ejemplo n.º 15
0
 public NmsConsumer CreateConsumer(Destination destination, Action<IMessage> messageReceivedCallback, string selector = null)
 {
     return new NmsConsumer(this, destination, messageReceivedCallback, selector);
 }
Ejemplo n.º 16
0
 NmsConsumer INmsConnection.CreateConsumer(Destination destination, Action<IMessage> messageReceivedCallback)
 {
     return new NmsConsumer(this, destination, messageReceivedCallback);
 }
Ejemplo n.º 17
0
 public NmsMultiConsumer CreateMultiConsumer(Destination destination, int consumerCount, Func<MessageFactory, IMessage, IMessage> messageReceivedCallback, string selector = null)
 {
     return new NmsMultiConsumer(this, destination, consumerCount, messageReceivedCallback, selector);
 }
Ejemplo n.º 18
0
 NmsMultiConsumer INmsConnection.CreateMultiConsumer(Destination destination, int consumerCount, Func<MessageFactory, IMessage, IMessage> messageReceivedCallback)
 {
     return new NmsMultiConsumer(this, destination, consumerCount, messageReceivedCallback);
 }
Ejemplo n.º 19
0
 public NmsMultiConsumer CreateMultiConsumer(Destination destination, int consumerCount, Action<IMessage> messageReceivedCallback)
 {
     return new NmsMultiConsumer(this, destination, consumerCount, messageReceivedCallback);
 }
Ejemplo n.º 20
0
 NmsProducer INmsConnection.CreateProducer(Destination destination, MsgDeliveryMode messageDeliveryMode)
 {
     return new NmsProducer(this, destination, messageDeliveryMode);
 }
Ejemplo n.º 21
0
 public NmsProducer CreateProducer(Destination destination, MsgDeliveryMode messageDeliveryMode = MsgDeliveryMode.Persistent, bool synchronous = false)
 {
     return new NmsProducer(this, destination, messageDeliveryMode, synchronous);
 }
Ejemplo n.º 22
0
 NmsProducer INmsConnection.CreateSynchronousProducer(Destination destination, MsgDeliveryMode messageDeliveryMode)
 {
     return this.GetConnection().CreateProducer(destination, messageDeliveryMode: messageDeliveryMode, synchronous: true);
 }
Ejemplo n.º 23
0
 public void SendRequest(Destination destination, IMessage message)
 {
     this.producer.Send(destination.GetDestination(this.session), message);
 }