영업: 1-800-867-1380

ViaPartitionKey 속성

트랜잭션을 사용하여 전송 큐를 통해 메시지를 보낼 때의 파티션 키를 가져오거나 설정합니다.

네임스페이스:  Microsoft.ServiceBus.Messaging
어셈블리:  Microsoft.ServiceBus(Microsoft.ServiceBus.dll)

public string ViaPartitionKey { get; set; }

속성 값

유형: System..::..String
트랜잭션을 사용하여 전송 큐를 통해 메시지를 보낼 때의 파티션 키입니다.

Service Bus supports sending messages to a partitioned queue or topic via a partitioned transfer queue. In this case, the regular partition key (SessionId, PartitionKey, or MessageId) of the message is used for the destination queue or topic. If the transfer queue is partitioned and the ViaPartitionKey property is set, then the ViaPartitionKey value is used as a partition key for the transfer queue. If the ViaPartitionKey property is not set, then Service Bus uses an internal algorithm to assign messages to the fragments of the transfer queue.

If a transaction is used to send messages via a transfer queue, the ViaPartitionKey property must be set on these messages. If a single transaction is used to send multiple messages via a same transfer queue, the ViaPartitionKey property of all messages must be set to the same value.

MessageSender viaMessageSender = messagingfactory.CreateMessageSender(transferDestinationEntityPath: targetQueue.Path, viaEntityPath: transferQueue.Path);
CommittableTransaction committableTransaction = new CommittableTransaction();
using (TransactionScope ts = new TransactionScope(committableTransaction))
{
    BrokeredMessage msg = new BrokeredMessage("This is a message");
    msg.ViaPartitionKey = "myPartitionKey"; // Used as a partition key for transfer queue.
    msg.SessionId = "mySessionId"; // Used as a partition key for destination queue.
    viaMessageServer.Send(msg); 
    ts.Complete();
}
committableTransaction.Commit();
이 정보가 도움이 되었습니까?
(1500자 남음)
의견을 주셔서 감사합니다.

커뮤니티 추가 항목

추가
표시:
© 2014 Microsoft