private IMessage Run (MessageQueueTransactionType transactionType, RecieveDelegate r) { switch (transactionType) { case MessageQueueTransactionType.Single: using (RabbitMQMessageQueueTransaction tx = GetTx ()) { bool success = false; try { IMessage msg = Run (tx, r); tx.Commit (); success = true; return msg; } finally { if (!success) tx.Abort (); } } case MessageQueueTransactionType.None: return Run (r); default: throw new NotSupportedException(transactionType + " not supported"); } }
private IMessage DoReceive(IMessageQueueTransaction transaction, TimeSpan timeout, IsMatch matcher, bool ack) { RabbitMQMessageQueueTransaction tx = (RabbitMQMessageQueueTransaction)transaction; return(DoReceive((IMessagingContext)tx, timeout, matcher, ack)); }
private IMessage DoReceive(MessageQueueTransactionType transactionType, TimeSpan timeout, IsMatch matcher, bool ack) { switch (transactionType) { case MessageQueueTransactionType.Single: using (RabbitMQMessageQueueTransaction tx = NewTx()) { bool success = false; try { IMessage msg = DoReceive((IMessagingContext)tx, timeout, matcher, ack); tx.Commit(); success = true; return(msg); } finally { if (!success) { tx.Abort(); } } } case MessageQueueTransactionType.None: return(DoReceive(timeout, matcher, true)); default: throw new NotSupportedException(transactionType + " not supported"); } }
private IMessage Run (IMessageQueueTransaction transaction, RecieveDelegate r) { TxReceiver txr = new TxReceiver (this, r); RabbitMQMessageQueueTransaction tx = (RabbitMQMessageQueueTransaction) transaction; return tx.RunReceive (txr.ReceiveInContext); }
public void Send (IMessage msg, IMessageQueueTransaction transaction) { if (QRef == QueueReference.DEFAULT) throw new MonoMessagingException ("Path has not been specified"); if (msg.BodyStream == null) throw new ArgumentException ("Message is not serialized properly"); RabbitMQMessageQueueTransaction tx = (RabbitMQMessageQueueTransaction) transaction; tx.RunSend (SendInContext, msg); }
public void Send(IMessage msg, IMessageQueueTransaction transaction) { if (QRef == QueueReference.DEFAULT) { throw new MonoMessagingException("Path has not been specified"); } if (msg.BodyStream == null) { throw new ArgumentException("Message is not serialized properly"); } RabbitMQMessageQueueTransaction tx = (RabbitMQMessageQueueTransaction)transaction; SetDeliveryInfo(msg, tx.Id); tx.Send(QRef, msg); }