Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding CLI script for GeoDR with no update to existing clients #381

Merged
merged 4 commits into from
Apr 13, 2018

Conversation

ShubhaVijayasarathy
Copy link
Contributor

Adding CLI script for Geo DR

sabeegrewal
sabeegrewal previously approved these changes Apr 10, 2018
Copy link
Contributor

@SreeramGarlapati SreeramGarlapati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for driving this & the gr8 work @ShubhaVijayasarathy !! few changes away from awsmness.!

Please take @sjkwak 's help to get GEO DR changes reviewed.

@@ -0,0 +1,30 @@
# Receive events from Azure Event Hubs using Java

This sample shows how to receive events from a particular Event Hub partition based on a sequence number. This is a lower-level API gesture that most applications will not use, but rather lean on the Event Processor Host to manage partition ownership and check-pointing. The [Event Processor Sample](../EventProcessorSample) shows this higher level functionality.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see if we can get 1 critical info straight out to customer:

  • Creating receiver based on sequence# is expensive. To get best performance - create one based on Offset. Creating by seq# - service internally tries to resolve this to Offset.

// Send - not tied to any partition
// EventHubs service will round-robin the events across all EventHubs partitions.
// This is the recommended & most reliable way to send to EventHubs.
ehClient.send(sendEvent).get();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ehClient.sendSync() variant instead of send(..).get();

System.out.println(Instant.now() + ": Send Complete...");
System.in.read();
} finally {
ehClient.closeSync();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comment here - to elaborate that - ehClient can be repetitively used to send for longer duration & that ehClient.closeSync() cleans up resources - io/socket.
Since, ehClient creation involves creating a connection and ssl hand-shake with service - its an expense operation.

* **SendBatch** - The [SendBatch](./Basic/SendBatch) sample illustrates how to ingest batches of events into your event hub.
* **SimpleSend** - The [SimpleSend](./Basic/SimpleSend) sample illustrates how to ingest events into your event hub.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider renaming this to
send - this feels like what is shown in simple send.
sendBatch
advancedSend - add partition scenarios here - and provide guidance that - these types of sends comes with more partition control and lower availability.

</build>
<dependencies>
<dependency>
<groupId>com.microsoft.azure</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use latest version1.0.1


final Gson gson = new GsonBuilder().create();

final ExecutorService executorService = Executors.newSingleThreadExecutor();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment here to provide guidance on executorservice.
mention that - we used single thread executor - as there is only 1 EHclient created for this simple sample. But, in general - customers will need to think thru and model their thread pool size - and can share the ExecutorService across multiple EHClient instances.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could probably cater to all samples.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will try to keep this sample simple and add the details to the other send options.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect this sample to be used the most! so, please see if you can add this critical detail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added. Let me if it sounds about right. And for PS and CLI scripts for Geo-DR, they have been tested before adding here :)

@@ -0,0 +1,30 @@
# Receive events from Azure Event Hubs using Java

This sample shows how to receive events from a particular Event Hub partition based on a sequence number. This is a lower-level API gesture that most applications will not use, but rather lean on the Event Processor Host to manage partition ownership and check-pointing. The [Event Processor Sample](../EventProcessorSample) shows this higher level functionality.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to see if we can elaborate "lower-level api gesture".
Briefly explain - that since, each eventhub have multiple partitions - and since this receiver can only receive off of a single partition - we also provide a library - which developers can use to receive off of all partitions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, will update the changes. Thank you :)

@ShubhaVijayasarathy ShubhaVijayasarathy merged commit b43364e into Azure:master Apr 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants