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; }
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); }
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; }
public void SendRequest(Destination destination, IMessage message) { this.producer.Send(destination.GetDestination(this.session), message); }