Exporteren (0) Afdrukken
Alles uitvouwen
EN
Deze inhoud is niet beschikbaar in uw taal, maar wel in het Engels.

QueueClient Class

Represents the queue client object.

Namespace:  Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)

public abstract class QueueClient : MessageClientEntity

The QueueClient type exposes the following members.

  NameDescription
Public propertyIsClosed (Inherited from ClientEntity.)
Public propertyMessagingFactoryGets or sets the messaging factory.
Public propertyModeGets the message receive mode when processing the received message.
Public propertyPathGets or sets the full path name of the queue.
Public propertyPrefetchCountGets or sets the number of messages that the queue receiver can simultaneously request.
Public propertyRetryPolicy (Inherited from ClientEntity.)
Protected propertyThisLock (Inherited from ClientEntity.)
Top

  NameDescription
Public methodAbandon(Guid)Discards the message and relinquishes the message lock ownership.
Public methodAbandon(Guid, IDictionary<String, Object>)Discards the message and relinquishes the message lock ownership.
Public methodAbandonAsync(Guid)Asynchronously discards the message and relinquishes the message lock ownership.
Public methodAbandonAsync(Guid, IDictionary<String, Object>)Asynchronously discards the message and relinquishes the message lock ownership.
Public methodAbortPerforms abort functionality on the messaging entity. (Inherited from ClientEntity.)
Public methodAcceptMessageSession()Accepts a message session that allows grouping of related messages for processing in a single transaction.
Public methodAcceptMessageSession(String)Accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier.
Public methodAcceptMessageSession(TimeSpan)Accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.
Public methodAcceptMessageSession(String, TimeSpan)Accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier and wait time.
Public methodAcceptMessageSessionAsync()Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction.
Public methodAcceptMessageSessionAsync(String)Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier.
Public methodAcceptMessageSessionAsync(TimeSpan)Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.
Public methodAcceptMessageSessionAsync(String, TimeSpan)Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier and wait time.
Public methodBeginAbandon(Guid, AsyncCallback, Object)Begins an asynchronous operation to abandon the message and relinquish its lock.
Public methodBeginAbandon(Guid, IDictionary<String, Object>, AsyncCallback, Object)Begins an asynchronous operation to abandon the message and relinquish its lock.
Public methodBeginAcceptMessageSession(AsyncCallback, Object)Begins an asynchronous operation to accept a message session.
Public methodBeginAcceptMessageSession(String, AsyncCallback, Object)Begins an asynchronous operation to accept a message session.
Public methodBeginAcceptMessageSession(TimeSpan, AsyncCallback, Object)Begins an asynchronous operation to accept a message session.
Public methodBeginAcceptMessageSession(String, TimeSpan, AsyncCallback, Object)Begins an asynchronous operation to accept a message session.
Public methodBeginCloseBegins an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.)
Public methodBeginCompleteBegins an asynchronous operation to complete processing of a message.
Public methodBeginCompleteBatchBegins an asynchronous operation to complete processing of a message batch.
Public methodBeginDeadLetter(Guid, AsyncCallback, Object)Begins an asynchronous operation to move a message to the dead letter queue.
Public methodBeginDeadLetter(Guid, IDictionary<String, Object>, AsyncCallback, Object)Begins an asynchronous operation to move a message to the dead letter queue.
Public methodBeginDeadLetter(Guid, String, String, AsyncCallback, Object)Begins an asynchronous operation to move a message to the dead letter queue.
Public methodBeginDefer(Guid, AsyncCallback, Object)Begins an asynchronous operation to suspend processing of a message.
Public methodBeginDefer(Guid, IDictionary<String, Object>, AsyncCallback, Object)Begins an asynchronous operation to suspend processing of a message.
Public methodBeginGetMessageSessions(AsyncCallback, Object)Begins an asynchronous operation to get the message sessions.
Public methodBeginGetMessageSessions(DateTime, AsyncCallback, Object)Begins an asynchronous operation to get the message sessions.
Public methodBeginPeek(AsyncCallback, Object)Begins an asynchronous operation to peek a message.
Public methodBeginPeek(Int64, AsyncCallback, Object)Begins an asynchronous operation to peek a message.
Public methodBeginPeekBatch(Int32, AsyncCallback, Object)Begins an asynchronous operation to peek a batch of messages.
Public methodBeginPeekBatch(Int64, Int32, AsyncCallback, Object)Begins an asynchronous operation to peek a batch of messages.
Public methodBeginReceive(AsyncCallback, Object)Begins an asynchronous operation to receive a message.
Public methodBeginReceive(Int64, AsyncCallback, Object)Begins an asynchronous operation to receive a message.
Public methodBeginReceive(TimeSpan, AsyncCallback, Object)Begins an asynchronous operation to receive a message.
Public methodBeginReceiveBatch(IEnumerable<Int64>, AsyncCallback, Object)Begins an asynchronous operation to receive a message batch.
Public methodBeginReceiveBatch(Int32, AsyncCallback, Object)Begins an asynchronous operation to receive a message batch.
Public methodBeginReceiveBatch(Int32, TimeSpan, AsyncCallback, Object)Begins an asynchronous operation to receive a message batch.
Public methodBeginSendBegins an asynchronous operation to send a message.
Public methodBeginSendBatchBegins an asynchronous operation to send a message batch.
Public methodCloseSends a cleanup message to Service Bus to signal the completion of the usage of an entity. (Inherited from ClientEntity.)
Public methodCloseAsyncSends a cleanup message asynchronously to Service Bus to signal the completion of the usage of an entity. (Inherited from ClientEntity.)
Public methodCompleteCompletes processing of a message.
Public methodCompleteAsyncAsynchronously completes processing of a message.
Public methodCompleteBatchCompletes processing of a message batch.
Public methodCompleteBatchAsyncAsynchronously completes processing of a message batch.
Public methodStatic memberCreate(String)Creates a new copy of QueueClient with specified path.
Public methodStatic memberCreate(String, ReceiveMode)Creates a new copy of QueueClient with specified path and mode.
Public methodStatic memberCreateFromConnectionString(String, String)Creates a new copy of QueueClient from connection string with specified path.
Public methodStatic memberCreateFromConnectionString(String, String, ReceiveMode)Creates a new copy of QueueClient from connection string with specified path and mode.
Public methodDeadLetter(Guid)Moves the undelivered message to the dead letter queue.
Public methodDeadLetter(Guid, IDictionary<String, Object>)Moves the undelivered message to the dead letter queue.
Public methodDeadLetter(Guid, String, String)Moves the undelivered message to the dead letter queue.
Public methodDeadLetterAsync(Guid)Asynchronously moves the undelivered message to the dead letter queue.
Public methodDeadLetterAsync(Guid, IDictionary<String, Object>)Asynchronously moves the undelivered message to the dead letter queue.
Public methodDeadLetterAsync(Guid, String, String)Asynchronously moves the undelivered message to the dead letter queue.
Public methodDefer(Guid)Suspends the processing of a message.
Public methodDefer(Guid, IDictionary<String, Object>)Suspends the processing of a message.
Public methodDeferAsync(Guid)Asynchronously suspends the processing of a message.
Public methodDeferAsync(Guid, IDictionary<String, Object>)Asynchronously suspends the processing of a message.
Public methodEndAbandonFinishes an asynchronous operation to abandon the message and relinquish its lock.
Public methodEndAcceptMessageSessionFinishes an asynchronous operation to accept a message session that allows grouping of related messages for processing in a single transaction.
Public methodEndCloseFinishes an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.)
Public methodEndCompleteFinishes an asynchronous operation to complete processing of a message.
Public methodEndCompleteBatchFinishes an asynchronous operation to complete processing of a message batch.
Public methodEndDeadLetterFinishes an asynchronous operation to move message to the dead letter queue.
Public methodEndDeferFinishes an asynchronous operation to suspend processing of a message.
Public methodEndGetMessageSessionsEnds an asynchronous operation to get the message sessions.
Public methodEndPeekEnds an asynchronous operation to peek a message.
Public methodEndPeekBatchEnds an asynchronous operation to peek a batch of messages.
Public methodEndReceiveFinishes an asynchronous operation to receive a message.
Public methodEndReceiveBatchFinishes an asynchronous operation to receive a message batch.
Public methodEndSendFinishes an asynchronous operation to send a message.
Public methodEndSendBatchFinishes an asynchronous operation to send a message batch.
Public methodEquals (Inherited from Object.)
Protected methodFaultFor internal use only. Do not inherit from this class. (Inherited from ClientEntity.)
Protected methodFinalize (Inherited from Object.)
Public methodStatic memberFormatDeadLetterPathBuilds a format name from the specified dead letter queue path.
Public methodGetHashCode (Inherited from Object.)
Public methodGetMessageSessions()Gets the message sessions, enabling you to browse sessions on queues.
Public methodGetMessageSessions(DateTime)Retrieves all message sessions whose session state was updated since lastUpdatedTime.
Public methodGetMessageSessionsAsync()Asynchronously gets the message sessions, enabling you to browse sessions on queues.
Public methodGetMessageSessionsAsync(DateTime)Asynchronously retrieves all message sessions whose session state was updated since lastUpdatedTime.
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodOnAbortExecutes upon calling the Abort event. (Overrides ClientEntity.OnAbort().)
Protected methodOnBeginAcceptMessageSessionExecutes upon calling the BeginAcceptMessageSession operation.
Protected methodOnBeginCloseExecutes when the Close operation is called. (Overrides ClientEntity.OnBeginClose(TimeSpan, AsyncCallback, Object).)
Protected methodOnBeginCreateReceiver(ReceiveMode, TimeSpan, AsyncCallback, Object)Executes the begin create receiver action.
Protected methodOnBeginCreateReceiver(String, ReceiveMode, TimeSpan, AsyncCallback, Object)Executes the begin create receiver action.
Protected methodOnBeginCreateSenderExecutes the begin create sender action.
Protected methodOnBeginGetMessageSessionsExecutes the BeginGetMessageSessions action.
Protected methodOnBeginOpen (Inherited from ClientEntity.)
Protected methodOnCloseExecutes upon calling the Close action. (Overrides ClientEntity.OnClose(TimeSpan).)
Protected methodOnClosed (Inherited from ClientEntity.)
Protected methodOnEndAcceptMessageSessionExecutes upon calling the EndAcceptMessageSession operation.
Protected methodOnEndCloseExecutes the end close action. (Overrides ClientEntity.OnEndClose(IAsyncResult).)
Protected methodOnEndCreateReceiverExecutes the end create receiver action.
Protected methodOnEndCreateSenderExecutes the end create sender action.
Protected methodOnEndGetMessageSessionsExecutes the end get message action.
Protected methodOnEndOpen (Inherited from ClientEntity.)
Protected methodOnFaulted (Inherited from ClientEntity.)
Public methodOnMessage(Action<BrokeredMessage>)Processes a message in an event-driven message pump.
Public methodOnMessage(Action<BrokeredMessage>, OnMessageOptions)Processes a message in an event-driven message pump, with the given set of OnMessageOptions options.
Public methodOnMessageAsync(Func<BrokeredMessage, Task>)Asynchronously processes a message.
Public methodOnMessageAsync(Func<BrokeredMessage, Task>, OnMessageOptions)Asynchronously processes a message.
Protected methodOnOpen (Inherited from ClientEntity.)
Protected methodOnOpened (Inherited from ClientEntity.)
Public methodPeek()Returns without removing the first message in the queue.
Public methodPeek(Int64)Returns without removing the first message in the queue.
Public methodPeekAsync()Asynchronously returns without removing the first message in the queue.
Public methodPeekAsync(Int64)Asynchronously returns without removing the first message in the queue.
Public methodPeekBatch(Int32)Peeks a batch of message.
Public methodPeekBatch(Int64, Int32)Peeks a batch of messages.
Public methodPeekBatchAsync(Int32)Asynchronously peeks a batch of message.
Public methodPeekBatchAsync(Int64, Int32)Asynchronously peeks a batch of message.
Public methodReceive()Receives a message using the InternalReceiver().
Public methodReceive(Int64)Receives a message using the InternalReceiver().
Public methodReceive(TimeSpan)Receives a message using the InternalReceiver().
Public methodReceiveAsync()Asynchronously receives a message using the InternalReceiver().
Public methodReceiveAsync(Int64)Asynchronously receives a message using the InternalReceiver().
Public methodReceiveAsync(TimeSpan)Asynchronously receives a message using the InternalReceiver().
Public methodReceiveBatch(IEnumerable<Int64>)Receives a message batch.
Public methodReceiveBatch(Int32)Receives a message batch.
Public methodReceiveBatch(Int32, TimeSpan)Receives a message batch.
Public methodReceiveBatchAsync(IEnumerable<Int64>)Asynchronously receives a message batch.
Public methodReceiveBatchAsync(Int32)Asynchronously receives a message batch.
Public methodReceiveBatchAsync(Int32, TimeSpan)Asynchronously receives a message batch.
Public methodRegisterSessionHandler(Type)Registers the session handler with specific type.
Public methodRegisterSessionHandler(Type, SessionHandlerOptions)Registers the session handler with specific type and handler options.
Public methodRegisterSessionHandlerAsync(Type)Asynchronously registers the session handler with specific type.
Public methodRegisterSessionHandlerAsync(Type, SessionHandlerOptions)Asynchronously registers the session handler with specific type and handler options.
Public methodRegisterSessionHandlerFactory(IMessageSessionAsyncHandlerFactory, SessionHandlerOptions)Registers a message session handler factory with specified options.
Public methodRegisterSessionHandlerFactory(IMessageSessionHandlerFactory, SessionHandlerOptions)Registers a message session handler factory with specified options.
Public methodRegisterSessionHandlerFactoryAsync(IMessageSessionAsyncHandlerFactory, SessionHandlerOptions)Asynchronously registers a message session handler factory.
Public methodRegisterSessionHandlerFactoryAsync(IMessageSessionHandlerFactory, SessionHandlerOptions)Asynchronously registers a message session handler factory.
Public methodSendSends a message using the InternalSender().
Public methodSendAsyncAsynchronously sends a message using the InternalSender().
Public methodSendBatchSends a set of brokered messages (for batch processing).
Public methodSendBatchAsyncAsynchronously sends a set of brokered messages (for batch processing).
Protected methodThrowIfClosed (Inherited from ClientEntity.)
Protected methodThrowIfDisposed (Inherited from ClientEntity.)
Protected methodThrowIfDisposedOrImmutable (Inherited from ClientEntity.)
Protected methodThrowIfDisposedOrNotOpen (Inherited from ClientEntity.)
Protected methodThrowIfFaulted (Inherited from ClientEntity.)
Public methodToString (Inherited from Object.)
Top

This class is mainly used for Service Bus run-time operations, such as sending and receiving messages.

This abstract class is not meant to be inherited, so protected members of this class should be ignored.

// Create the MessagingFactory
     MessagingFactory factory = 
     MessagingFactory.Create(myServiceBusNamespaceUri, SharedSecretTokenProvider.CreateSharedSecretTokenProvider(issuerName, issuerKey));
    
     //********************************************************************************
     //                          Sending messages to a Queue
     //********************************************************************************
    
     // Create queue client
     QueueClient myQueueClient = factory.CreateQueueClient("myQueue");
    
     // Send messages
     List <object>; Issues = new List <object>();
     foreach (var issue in Issues)
     {
        myQueueClient.Send(new BrokeredMessage(issue));
     }
    
     // ... Recieve messages
     for (int count = 0; count < MsgCount; count++)
     {
         var message = myQueueClient.Receive();
         message.Complete();
     }

Any public static (Shared in Visual Basic) members of this type are thread safe. Instance members are also guaranteed to be thread safe.

Community-inhoud

Toevoegen
Weergeven:
© 2014 Microsoft