2016-06-27 3 views

答えて

0

セクションCreate partitioned topics & Create a Topicによると、あなたは以下のコードを追加したり、リソース管理とREST APIを使用して経由でパーティショントピックを作成することができます。

ServiceBusContract service = ServiceBusService.create(config); 
TopicInfo topicInfo = new TopicInfo("TestTopic"); 
// Enable partitioning for topic 
topicInfo.setPartitioningPolicy(PartitioningPolicy.MESSAGE_PARTITIONING); 

詳細、クラスTopicInfo & PartitionPolicyのjavadocを参照してください。

トピック用のパーティションでJMSを使用してメッセージを送信する場合は、記事How to use Service Bus topics and subscriptionsを参照して、クラス鍵BrokeredMessageを使用してJavaコードを記述してください。以下のコードを参照してください。

BrokeredMessage message = new BrokeredMessage("MyMessage"); 
message.setPartitionKey("<partitionKey>"); 
service.sendTopicMessage("TestTopic", message); 

希望します。

関連する問題