本文整理汇总了C#中MessageQueueTransactionType类的典型用法代码示例。如果您正苦于以下问题:C# MessageQueueTransactionType类的具体用法?C# MessageQueueTransactionType怎么用?C# MessageQueueTransactionType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MessageQueueTransactionType类属于命名空间,在下文中一共展示了MessageQueueTransactionType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MsmqMessageDeliveryQueue
public MsmqMessageDeliveryQueue(string path, MessageQueueTransactionType transactionType, IMessageFormatter formatter)
{
_queue = new MessageQueue(path);
_formatter = new MessageDeliveryFormatter();
_transactionType = transactionType;
_formatter = formatter;
}
示例2: ValidateMessageQueueTransactionType
public static bool ValidateMessageQueueTransactionType(MessageQueueTransactionType value)
{
if ((value != MessageQueueTransactionType.None) && (value != MessageQueueTransactionType.Automatic))
{
return (value == MessageQueueTransactionType.Single);
}
return true;
}
示例3: ValidateMessageQueueTransactionType
public static bool ValidateMessageQueueTransactionType(MessageQueueTransactionType value)
{
//
// note that MessageQueueTransactionType has disjoined values
//
return (value == MessageQueueTransactionType.None) ||
(value == MessageQueueTransactionType.Automatic) ||
(value == MessageQueueTransactionType.Single);
}
示例4: MsmqTraceListener
/// <summary>
/// Initializes a new instance of <see cref="MsmqTraceListener"/>.
/// </summary>
/// <param name="name">The name of the new instance.</param>
/// <param name="queuePath">The path to the queue to deliver to.</param>
/// <param name="formater">The formatter to use.</param>
/// <param name="messagePriority">The priority for the messages to send.</param>
/// <param name="recoverable">The recoverable flag for the messages to send.</param>
/// <param name="timeToReachQueue">The timeToReachQueue for the messages to send.</param>
/// <param name="timeToBeReceived">The timeToBeReceived for the messages to send.</param>
/// <param name="useAuthentication">The useAuthentication flag for the messages to send.</param>
/// <param name="useDeadLetterQueue">The useDeadLetterQueue flag for the messages to send.</param>
/// <param name="useEncryption">The useEncryption flag for the messages to send.</param>
/// <param name="transactionType">The <see cref="MessageQueueTransactionType"/> for the message to send.</param>
public MsmqTraceListener(string name, string queuePath, ILogFormatter formater,
MessagePriority messagePriority, bool recoverable,
TimeSpan timeToReachQueue, TimeSpan timeToBeReceived,
bool useAuthentication, bool useDeadLetterQueue, bool useEncryption,
MessageQueueTransactionType transactionType)
: this(name, queuePath, formater, messagePriority, recoverable,
timeToReachQueue, timeToBeReceived,
useAuthentication, useDeadLetterQueue, useEncryption,
transactionType, new MsmqSendInterfaceFactory())
{
}
示例5: TryReceive
protected bool TryReceive(MessageQueueTransactionType transactionType, out Message message)
{
try
{
message = inputQueue.Receive(TimeSpan.FromMilliseconds(10), transactionType);
return true;
}
catch (MessageQueueException ex)
{
if (ex.MessageQueueErrorCode == MessageQueueErrorCode.IOTimeout)
{
//We should only get an IOTimeout exception here if another process removed the message between us peeking and now.
message = null;
return false;
}
throw;
}
}
示例6: MsmqTraceListener
/// <summary>
/// Initializes a new instance of <see cref="MsmqTraceListener"/>.
/// </summary>
/// <param name="name">The name of the new instance.</param>
/// <param name="queuePath">The path to the queue to deliver to.</param>
/// <param name="formater">The formatter to use.</param>
/// <param name="messagePriority">The priority for the messages to send.</param>
/// <param name="recoverable">The recoverable flag for the messages to send.</param>
/// <param name="timeToReachQueue">The timeToReachQueue for the messages to send.</param>
/// <param name="timeToBeReceived">The timeToBeReceived for the messages to send.</param>
/// <param name="useAuthentication">The useAuthentication flag for the messages to send.</param>
/// <param name="useDeadLetterQueue">The useDeadLetterQueue flag for the messages to send.</param>
/// <param name="useEncryption">The useEncryption flag for the messages to send.</param>
/// <param name="transactionType">The <see cref="MessageQueueTransactionType"/> for the message to send.</param>
/// <param name="msmqInterfaceFactory">The factory to create the msmq interfaces.</param>
public MsmqTraceListener(string name, string queuePath, ILogFormatter formater,
MessagePriority messagePriority, bool recoverable,
TimeSpan timeToReachQueue, TimeSpan timeToBeReceived,
bool useAuthentication, bool useDeadLetterQueue, bool useEncryption,
MessageQueueTransactionType transactionType,
IMsmqSendInterfaceFactory msmqInterfaceFactory)
: base(formater)
{
this.queuePath = queuePath;
this.messagePriority = messagePriority;
this.recoverable = recoverable;
this.timeToReachQueue = timeToReachQueue;
this.timeToBeReceived = timeToBeReceived;
this.useAuthentication = useAuthentication;
this.useDeadLetterQueue = useDeadLetterQueue;
this.useEncryption = useEncryption;
this.transactionType = transactionType;
this.msmqInterfaceFactory = msmqInterfaceFactory;
}
示例7: MsmqTraceListenerData
/// <summary>
/// Initializes a new instance of the <see cref="MsmqTraceListenerData"/> class.
/// </summary>
/// <param name="name">The name for the represented trace listener.</param>
/// <param name="queuePath">The path name for the represented trace listener.</param>
/// <param name="formatterName">The formatter name for the represented trace listener.</param>
/// <param name="messagePriority">The priority for the represented trace listener.</param>
/// <param name="recoverable">The recoverable flag for the represented trace listener.</param>
/// <param name="timeToReachQueue">The timeToReachQueue for the represented trace listener.</param>
/// <param name="timeToBeReceived">The timeToReachQueue for the represented trace listener.</param>
/// <param name="useAuthentication">The use authentication flag for the represented trace listener.</param>
/// <param name="useDeadLetterQueue">The use dead letter flag for the represented trace listener.</param>
/// <param name="useEncryption">The use encryption flag for the represented trace listener.</param>
/// <param name="transactionType">The transaction type for the represented trace listener.</param>
public MsmqTraceListenerData(string name, string queuePath, string formatterName,
MessagePriority messagePriority, bool recoverable,
TimeSpan timeToReachQueue, TimeSpan timeToBeReceived,
bool useAuthentication, bool useDeadLetterQueue, bool useEncryption,
MessageQueueTransactionType transactionType)
: this(name, queuePath, formatterName, messagePriority, recoverable, timeToReachQueue, timeToBeReceived,
useAuthentication, useDeadLetterQueue, useEncryption, transactionType, TraceOptions.None, SourceLevels.All)
{
}
示例8: Send
public void Send (object obj, string label, MessageQueueTransactionType transactionType)
{
if (typeof (Message) == obj.GetType ()) {
Message m = (Message) obj;
m.Label = label;
Send (m, transactionType);
} else {
Message m = new Message (obj);
Send (m, label, transactionType);
}
}
示例9: Send
public void Send(Message message, MessageQueueTransactionType transactionType)
{
this.message = message;
this.transactionType = transactionType;
numMessages++;
}
示例10: Send
public void Send(object obj, MessageQueueTransactionType transactionType) {}
示例11: ReceiveByCorrelationId
public Message ReceiveByCorrelationId(string correlationId, System.TimeSpan timeout, MessageQueueTransactionType transactionType) {}
示例12: ReceiveById
public Message ReceiveById(string id, System.TimeSpan timeout, MessageQueueTransactionType transactionType) {}
示例13: Run
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");
}
}
示例14: ReceiveByCorrelationId
public IMessage ReceiveByCorrelationId (string id, TimeSpan timeout,
MessageQueueTransactionType transactionType)
{
return Run (transactionType, Receiver (timeout, ByCorrelationId (id)));
}
示例15: Receive
public Message Receive(System.TimeSpan timeout, Cursor cursor, MessageQueueTransactionType transactionType) {}