MsmqTransportBindingElement 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表用於指定使用 Windows Communication Foundation(WCF)服務佇列通訊屬性的綁定元素,該服務使用原生訊息佇列(MSMQ)協定。
public ref class MsmqTransportBindingElement sealed : System::ServiceModel::Channels::MsmqBindingElementBase
public sealed class MsmqTransportBindingElement : System.ServiceModel.Channels.MsmqBindingElementBase
type MsmqTransportBindingElement = class
inherit MsmqBindingElementBase
Public NotInheritable Class MsmqTransportBindingElement
Inherits MsmqBindingElementBase
- 繼承
範例
string queueName = @".\private$\ServiceModelSamples";
if (!MessageQueue.Exists(queueName))
MessageQueue.Create(queueName, true);
using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService)))
{
BinaryMessageEncodingBindingElement encodingBindingElement = new BinaryMessageEncodingBindingElement();
MsmqTransportBindingElement transportBindingElement = new MsmqTransportBindingElement();
CustomBinding binding = new CustomBinding(encodingBindingElement, transportBindingElement);
serviceHost.AddServiceEndpoint(
typeof(IQueueCalculator),
binding,
"net.msmq://localhost/private/ServiceModelSamples");
serviceHost.Open();
// The service can now be accessed.
Console.WriteLine("The service is ready.");
Console.WriteLine("Press <ENTER> to terminate service.");
Console.WriteLine();
Console.ReadLine();
// Close the ServiceHost to shutdown the service.
serviceHost.Close();
備註
這 MsmqTransportBindingElement 讓使用者能夠設定佇列通訊通道的屬性。 排隊中的通訊通道使用訊息排隊進行傳輸。
此綁定元素是訊息佇列標準綁定()所使用的預設綁定元素。NetMsmqBinding
建構函式
| 名稱 | Description |
|---|---|
| MsmqTransportBindingElement() |
初始化 MsmqTransportBindingElement 類別的新執行個體。 |
屬性
| 名稱 | Description |
|---|---|
| CustomDeadLetterQueue |
接收或設定 A Uri ,識別一個自訂的死符佇列,用於傳送過期訊息或未送達訊息。 (繼承來源 MsmqBindingElementBase) |
| DeadLetterQueue |
取得或設定 DeadLetterQueue 這個綁定的設定。 (繼承來源 MsmqBindingElementBase) |
| Durable |
取得或設定一個值,指定使用此綁定發送的訊息是持久還是可變性。 (繼承來源 MsmqBindingElementBase) |
| ExactlyOnce |
取得或設定一個值,指定使用此綁定發送的訊息是否恰好有一次保證。 (繼承來源 MsmqBindingElementBase) |
| ManualAddressing |
取得或設定一個值,指示是否需要手動定址訊息。 (繼承來源 TransportBindingElement) |
| MaxBufferPoolSize |
取得或設定傳輸所使用緩衝池的最大大小(位元組)。 (繼承來源 TransportBindingElement) |
| MaxPoolSize |
取得或設定一個整數,指定包含內部訊息佇列(MSMQ)訊息物件的池最大大小。 |
| MaxReceivedMessageSize |
取得或設定可接收的最大允許訊息大小(以位元組為單位)。 (繼承來源 TransportBindingElement) |
| MaxRetryCycles |
取得或設定最大重試次數,以嘗試將訊息傳送給接收應用程式。 (繼承來源 MsmqBindingElementBase) |
| MsmqTransportSecurity |
會得到 MsmqTransportSecurity 與這個結合元素相關的 that。 (繼承來源 MsmqBindingElementBase) |
| QueueTransferProtocol |
取得或設定一個列舉值,指示此綁定所使用的排隊通訊通道傳輸。 |
| ReceiveContextEnabled |
取得或設定一個值,指示是否請求接收上下文行為。 (繼承來源 MsmqBindingElementBase) |
| ReceiveErrorHandling |
取得或設定一個列舉值,指定如何處理毒藥及其他無法派發的訊息。 (繼承來源 MsmqBindingElementBase) |
| ReceiveRetryCount |
接收或設定佇列管理器在將訊息傳送至重試隊列前,應嘗試發送訊息的最大次數。 (繼承來源 MsmqBindingElementBase) |
| RetryCycleDelay |
當嘗試傳遞無法送達的訊息時,會取得或設定一個值,指定在嘗試重試週期前等待多久再嘗試一次。 (繼承來源 MsmqBindingElementBase) |
| Scheme |
回傳包含此傳輸綁定元素所使用的位址方案的 a String 。 |
| TimeToLive |
取得或設定一個值,指定訊息有效長度。 當此時間過後,訊息會依設定被放入死信佇列 |
| TransactedReceiveEnabled |
會獲得一個值,指定交易是否必須接收帶有此綁定的訊息。 (繼承來源 MsmqBindingElementBase) |
| UseActiveDirectory |
回傳一個布林值,指示是否應該使用 Active Directory 轉換佇列位址。 |
| UseMsmqTracing |
取得或設定一個值,啟用或停用內建的訊息佇列(MSMQ)訊息追蹤功能。 (繼承來源 MsmqBindingElementBase) |
| UseSourceJournal |
取得或設定一個值,指示此綁定處理的訊息副本是否應儲存在原始日誌佇列中。 (繼承來源 MsmqBindingElementBase) |
| ValidityDuration |
取得或設定一個值,指定訊息會被接收上下文功能鎖定的時長。 (繼承來源 MsmqBindingElementBase) |
方法
| 名稱 | Description |
|---|---|
| BuildChannelFactory<TChannel>(BindingContext) |
利用提供的上下文建立通道工廠。 |
| BuildChannelListener<TChannel>(BindingContext) |
利用提供的上下文建立頻道監聽器。 |
| CanBuildChannelFactory<TChannel>(BindingContext) |
回傳一個布林值,表示你是否能在提供的上下文下建立通道工廠。 |
| CanBuildChannelListener<TChannel>(BindingContext) |
回傳一個布林值,表示你是否能根據所提供的上下文建立頻道監聽器。 |
| Clone() |
回傳一個結合元素的複製品。 |
| Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
| GetHashCode() |
做為預設哈希函式。 (繼承來源 Object) |
| GetProperty<T>(BindingContext) |
當在派生類別中覆寫時,會取得指定類型的物件,以符合所提供的綁定上下文。 (繼承來源 MsmqBindingElementBase) |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |
明確介面實作
| 名稱 | Description |
|---|---|
| IPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext) |
匯出關於綁定的自訂政策斷言。 (繼承來源 MsmqBindingElementBase) |
| IWsdlExportExtension.ExportContract(WsdlExporter, WsdlContractConversionContext) |
將自訂的 Web Services Description Language(WSDL)元素寫入合約產生的 WSDL。 (繼承來源 MsmqBindingElementBase) |
| IWsdlExportExtension.ExportEndpoint(WsdlExporter, WsdlEndpointConversionContext) |
將自訂的 Web Services Description Language(WSDL)元素寫入產生的端點 WSDL。 (繼承來源 MsmqBindingElementBase) |