2つのパーティション(0と1)を持つAzureポータルでイベントハブを作成しました。サービスバスのようなイベントハブにトピックの概念がないため。私はパーティション1AzureイベントハブにAzure Service Busトピックがありますか?
マイrecieiverロジックに保存されたばかりのパーティション、それはデフォルトで0にデータを格納しようとしていたとしても
ehClient = EventHubClient.createFromConnectionStringSync(eventHubConnectionString.toString());
byte[] payload = "Storing data in partion 0".getBytes("UTF-8");
/** Storing data in partion 0*/
EventData data = new EventData(payload);
ehClient .send(data, "0");
使用して、パーティション0とパーティション1の異なるデータを格納しようとしています次のとおりです。
eventHubClient = EventHubClient.create(Constant.EVENTHUB_SASKEYNAME,
Constant.EVENTHUB_SASKEY, Constant.EVENTHUB_NAMESPACE, Constant.EVENTHUB_NAME);
EventHubConsumerGroup eventHubConsumerGroup = eventHubClient.getConsumerGroup("$Default");
eventHubReceiver = eventHubConsumerGroup.createReceiver("0", null, -1);
while (true) {
message = eventHubReceiver.receive(-1);
if (null != message)
System.out.println("The message that is delivered is : " + message.getPayload());
else
System.out.println("No message in the hub");
}
パーティションにデータを保存するのは正しい方法ですか? Azure Serviceのバストピックと同等のパーティションを使用できますか?
いいえ、http://stackoverflow.com/questions/42255265/how-are-different-events-handled-in-azure-event-hubsを参照してください。 –