Receive-MsmqQueue

Receive-MsmqQueue

Does a destructive read from a queue.

구문

Parameter Set: Transactional
Receive-MsmqQueue -InputObject <MessageQueue> [-Count <Int32> ] [-RetrieveBody] [-Timeout <TimeSpan> ] [-Transactional] [ <CommonParameters>]

Parameter Set: Peek
Receive-MsmqQueue -InputObject <MessageQueue> [-Count <Int32> ] [-Peek] [-RetrieveBody] [-Timeout <TimeSpan> ] [ <CommonParameters>]

자세한 설명

The Receive-MsmqQueue cmdlet does a destructive read from a queue. The cmdlet returns the received System.Messaging.Message object. This cmdlet accepts values for the Name parameter of path names, format names, and direct format names. Some other Message Queuing (also known as MSMQ) cmdlets require a friendly name for the queue. If you specify the Peek parameter, the cmdlet peeks at the message instead of doing a destructive read. The cmdlet succeeds if it returns at least one message.

If you specify the Peek parameter, this cmdlet returns the number of messages that is the minimum of the number supplied by the Count parameter and the number of messages in the queue.

매개 변수

-Count<Int32>

Specifies the number of messages to be returned. The default value is 1. You must specify a value greater than 0.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-InputObject<MessageQueue>

Specifies a MessageQueue object. The cmdlet reads from the queue that the MessageQueue specifies. This parameter accepts pipeline input.

별칭

없음

필수 여부

true

위치

named

기본값

없음

파이프라인 입력 적용 여부

true (ByValue)

와일드카드 문자 허용 여부

false

-Peek

Indicates that this cmdlet returns a copy of the first message in the queue without removing the message from the queue.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-RetrieveBody

Indicates that this cmdlet returns the body of the message.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Timeout<TimeSpan>

Specifies the maximum time, in milliseconds, to wait for the queue to contain a message. The default value is 0.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Transactional

Indicates that the cmdlet performs a transacted receive.

별칭

없음

필수 여부

false

위치

named

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

예제

Example 1

PS C:\> Get-MsmqMessage -Name "a04bm10\private$\order_queue" | Receive-MsmqQueue -Transactional 

관련 항목

Clear-MsmqQueue

Get-MsmqQueue

New-MsmqQueue

Remove-MsmqQueue

Send-MsmqQueue

Set-MsmqQueue