本文整理汇总了C#中MessageQueueTransactionType类的典型用法代码示例。如果您正苦于以下问题:C# MessageQueueTransactionType类的具体用法?C# MessageQueueTransactionType怎么用?C# MessageQueueTransactionType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MessageQueueTransactionType类属于命名空间,在下文中一共展示了MessageQueueTransactionType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MsmqMessageDeliveryQueue
public MsmqMessageDeliveryQueue(string path, MessageQueueTransactionType transactionType, IMessageFormatter formatter)
{
_queue = new MessageQueue(path);
_formatter = new MessageDeliveryFormatter();
_transactionType = transactionType;
_formatter = formatter;
}
开发者ID:jezell,项目名称:iserviceoriented,代码行数:7,代码来源:MsmqMessageDeliveryQueue.cs
示例2: ValidateMessageQueueTransactionType
public static bool ValidateMessageQueueTransactionType(MessageQueueTransactionType value)
{
if ((value != MessageQueueTransactionType.None) && (value != MessageQueueTransactionType.Automatic))
{
return (value == MessageQueueTransactionType.Single);
}
return true;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ValidationUtility.cs
示例3: ValidateMessageQueueTransactionType
public static bool ValidateMessageQueueTransactionType(MessageQueueTransactionType value)
{
//
// note that MessageQueueTransactionType has disjoined values
//
return (value == MessageQueueTransactionType.None) ||
(value == MessageQueueTransactionType.Automatic) ||
(value == MessageQueueTransactionType.Single);
}
开发者ID:JianwenSun,项目名称:cc,代码行数:9,代码来源:ValidationUtility.cs
示例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())
{
}
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:25,代码来源:MsmqTraceListener.cs
示例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;
}
}
开发者ID:Particular,项目名称:NServiceBus,代码行数:19,代码来源:ReceiveStrategy.cs
示例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;
}
开发者ID:wuyingyou,项目名称:uniframework,代码行数:34,代码来源:MsmqTraceListener.cs
示例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)
{
}
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:23,代码来源:MsmqTraceListenerData.cs
示例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);
}
}
开发者ID:nlhepler,项目名称:mono,代码行数:11,代码来源:MessageQueue.cs
示例9: Send
public void Send(Message message, MessageQueueTransactionType transactionType)
{
this.message = message;
this.transactionType = transactionType;
numMessages++;
}
开发者ID:bnantz,项目名称:NCS-V2-0,代码行数:6,代码来源:MsmqTraceListenerFixture.cs
示例10: Send
public void Send(object obj, MessageQueueTransactionType transactionType) {}
开发者ID:Pengfei-Gao,项目名称:source-Insight-3-for-centos7,代码行数:1,代码来源:MessageQueue.cs
示例11: ReceiveByCorrelationId
public Message ReceiveByCorrelationId(string correlationId, System.TimeSpan timeout, MessageQueueTransactionType transactionType) {}
开发者ID:Pengfei-Gao,项目名称:source-Insight-3-for-centos7,代码行数:1,代码来源:MessageQueue.cs
示例12: ReceiveById
public Message ReceiveById(string id, System.TimeSpan timeout, MessageQueueTransactionType transactionType) {}
开发者ID:Pengfei-Gao,项目名称:source-Insight-3-for-centos7,代码行数:1,代码来源:MessageQueue.cs
示例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");
}
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:25,代码来源:RabbitMQMessageQueue.cs
示例14: ReceiveByCorrelationId
public IMessage ReceiveByCorrelationId (string id, TimeSpan timeout,
MessageQueueTransactionType transactionType)
{
return Run (transactionType, Receiver (timeout, ByCorrelationId (id)));
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:5,代码来源:RabbitMQMessageQueue.cs
示例15: Receive
public Message Receive(System.TimeSpan timeout, Cursor cursor, MessageQueueTransactionType transactionType) {}
开发者ID:Pengfei-Gao,项目名称:source-Insight-3-for-centos7,代码行数:1,代码来源:MessageQueue.cs
示例16: Send
/// <summary>
/// Sends a message to the underlying MSMQ.
/// </summary>
/// <param name="message">The <see cref="Message"/> to send.</param>
/// <param name="transactionType">The <see cref="MessageQueueTransactionType"/> value that specifies the type of transaciton to use.</param>
public void Send(Message message, MessageQueueTransactionType transactionType)
{
messageQueue.Send(message, transactionType);
}
开发者ID:wuyingyou,项目名称:uniframework,代码行数:9,代码来源:MsmqSendInterface.cs
示例17: ReceiveById
/// <summary>
/// Receives the message that matches the given identifier and waits until either a message with the specified identifier is available in the queue or the time-out expires.
/// </summary>
/// <returns>
/// The <see cref="T:System.Messaging.Message"/> whose <see cref="P:System.Messaging.Message.Id"/> property matches the <paramref name="id"/> parameter passed in.
/// </returns>
/// <param name="id">The <see cref="P:System.Messaging.Message.Id"/> of the message to receive. </param><param name="timeout">A <see cref="T:System.TimeSpan"/> that indicates the time to wait until a new message is available for inspection. </param><param name="transactionType">One of the <see cref="T:System.Messaging.MessageQueueTransactionType"/> values, describing the type of transaction context to associate with the message. </param><exception cref="T:System.ArgumentNullException">The <paramref name="id"/> parameter is null. </exception><exception cref="T:System.ArgumentException">The value specified for the <paramref name="timeout"/> parameter is not valid, possibly <paramref name="timeout"/> is less than <see cref="F:System.TimeSpan.Zero"/> or greater than <see cref="F:System.Messaging.MessageQueue.InfiniteTimeout"/>. </exception><exception cref="T:System.Messaging.MessageQueueException">A message with the specified <paramref name="id"/> did not arrive in the queue before the time-out expired.-or- An error occurred when accessing a Message Queuing method. </exception><exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The <paramref name="transactionType"/> parameter is not one of the <see cref="T:System.Messaging.MessageQueueTransactionType"/> members. </exception><PermissionSet><IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/><IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/><IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/><IPermission class="System.Messaging.MessageQueuePermission, System.Messaging, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" version="1" Unrestricted="true"/><IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/></PermissionSet>
public Message ReceiveById(string id, TimeSpan timeout, MessageQueueTransactionType transactionType)
{
return _queue.ReceiveById(id, timeout, transactionType);
}
开发者ID:petxo,项目名称:HermEsb,代码行数:11,代码来源:MessageQueueDecorator.cs
示例18: ReceiveByLookupId
public Message ReceiveByLookupId(MessageLookupAction action, long lookupId, MessageQueueTransactionType transactionType) {}
开发者ID:Pengfei-Gao,项目名称:source-Insight-3-for-centos7,代码行数:1,代码来源:MessageQueue.cs
示例19: ReceiveByLookupId
/// <summary>
/// Introduced in MSMQ 3.0. Receives a specific message from the queue, using the specified transaction context. The message can be specified by a lookup identifier or by its position at the front or end of the queue.
/// </summary>
/// <returns>
/// The <see cref="T:System.Messaging.Message"/> specified by the <paramref name="action"/> and <paramref name="lookupId"/> parameters passed in.
/// </returns>
/// <param name="action">One of the <see cref="T:System.Messaging.MessageLookupAction"/> values, specifying how the message is read in the queue. Specify one of the following:MessageLookupAction.Current: Receives the message specified by <paramref name="lookupId"/> and removes it from the queue.MessageLookupAction.Next: Receives the message following the message specified by <paramref name="lookupId"/> and removes it from the queue.MessageLookupAction.Previous: Receives the message preceding the message specified by <paramref name="lookupId"/> and removes it from the queue.MessageLookupAction.First: Receives the first message in the queue and removes it from the queue. The <paramref name="lookupId"/> parameter must be set to 0.MessageLookupAction.Last: Receives the last message in the queue and removes it from the queue. The <paramref name="lookupId"/> parameter must be set to 0.</param><param name="lookupId">The <see cref="P:System.Messaging.Message.LookupId"/> of the message to receive, or 0. 0 is used when accessing the first or last message in the queue. </param><param name="transactionType">One of the <see cref="T:System.Messaging.MessageQueueTransactionType"/> values, describing the type of transaction context to associate with the message.</param><exception cref="T:System.PlatformNotSupportedException">MSMQ 3.0 is not installed.</exception><exception cref="T:System.InvalidOperationException">The message with the specified <paramref name="lookupId"/> could not be found. </exception><exception cref="T:System.Messaging.MessageQueueException">An error occurred when accessing a Message Queuing method. </exception><exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The <paramref name="action"/> parameter is not one of the <see cref="T:System.Messaging.MessageLookupAction"/> members.-or- The <paramref name="transactionType"/> parameter is not one of the <see cref="T:System.Messaging.MessageQueueTransactionType"/> members.</exception>
public Message ReceiveByLookupId(MessageLookupAction action, long lookupId, MessageQueueTransactionType transactionType)
{
return _queue.ReceiveByLookupId(action, lookupId, transactionType);
}
开发者ID:petxo,项目名称:HermEsb,代码行数:11,代码来源:MessageQueueDecorator.cs
示例20: Receive
/// <summary>
/// Receives the first message available in the queue referenced by the <see cref="T:System.Messaging.MessageQueue"/>. This call is synchronous, and blocks the current thread of execution until a message is available.
/// </summary>
/// <returns>
/// A <see cref="T:System.Messaging.Message"/> that references the first message available in the queue.
/// </returns>
/// <param name="transactionType">One of the <see cref="T:System.Messaging.MessageQueueTransactionType"/> values, describing the type of transaction context to associate with the message. </param><exception cref="T:System.Messaging.MessageQueueException">An error occurred when accessing a Message Queuing method. </exception><exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The <paramref name="transactionType"/> parameter is not one of the <see cref="T:System.Messaging.MessageQueueTransactionType"/> members. </exception><PermissionSet><IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/><IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/><IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/><IPermission class="System.Messaging.MessageQueuePermission, System.Messaging, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" version="1" Unrestricted="true"/><IPermission class="System.Diagnostics.PerformanceCounterPermission, System, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Unrestricted="true"/></PermissionSet>
public Message Receive(MessageQueueTransactionType transactionType)
{
return _queue.Receive(transactionType);
}
开发者ID:petxo,项目名称:HermEsb,代码行数:11,代码来源:MessageQueueDecorator.cs
注:本文中的MessageQueueTransactionType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论