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

[event-hubs] doc improvements #9342

Merged
merged 6 commits into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/eventhub/event-hubs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 5.2.1 (Unreleased)
## 5.2.1 (2020-06-08)

- Fixes issue [#8584](https://github.com/Azure/azure-sdk-for-js/issues/8584)
where attempting to create AMQP links when the AMQP connection was in the
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/event-hubs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ hence sending events is not possible.

- Please notice that the connection string needs to be for an
[Event Hub-compatible endpoint](https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-messages-read-builtin)
e.g. "Endpoint=sb://my-iothub-namespace-[uid].servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;EntityPath=my-iot-hub-name"
(e.g. "Endpoint=sb://my-iothub-namespace-[uid].servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;EntityPath=my-iot-hub-name")

```javascript
const { EventHubConsumerClient } = require("@azure/event-hubs");
Expand Down
4 changes: 4 additions & 0 deletions sdk/eventhub/event-hubs/migrationguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ We've also merged the functionality from `EventProcessorHost` from the `@azure/e
`EventHubConsumerClient` in the `@azure/event-hubs` package, allowing `EventHubConsumerClient` to be the single
point of entry for receiving of any type (from single partition, all partitions, or with load balancing and checkpointing features) within Event Hubs.

Important note on checkpoints: `EventHubConsumerClient` does not support legacy checkpoint data.
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps clarify what legacy means here?

EventHubConsumerClient does not support legacy checkpoint data i.e the checkpoints made using the package @azure/event-processor-host.

In order to meet the goals set for unifying checkpoint data across languages for the new set of Event Hubs libraries and to make
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesnt tell me why the unification was needed across languages. How about this:

In order to support interopability between different programming languages, a unifying checkpoint format was needed. This and the need to support improvements to the algorithm used for ............ breaking changes were necessary.

improvements to the algorithm used for managing partition ownership, breaking changes were necessary.

### Granular control over retries

Retry logic and tuning has been externalized, allowing for better configuration
Expand Down
6 changes: 6 additions & 0 deletions sdk/eventhub/event-hubs/samples/javascript/receiveEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ async function main() {
{
// The callback where you add your code to process incoming events
processEvents: async (events, context) => {
// Note: It is possible for `events` to be an empty array.
// This can happen if there were no new events to receive
// in the `maxWaitTimeInSeconds`, which is defaulted to
// 60 seconds.
// The `maxWaitTimeInSeconds` can be changed by setting
// it in the `options` passed to `subscribe()`.
for (const event of events) {
console.log(
`Received event: '${event.body}' from partition: '${context.partitionId}' and consumer group: '${context.consumerGroup}'`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ export async function main() {
{
// The callback where you add your code to process incoming events
processEvents: async (events, context) => {
// Note: It is possible for `events` to be an empty array.
// This can happen if there were no new events to receive
// in the `maxWaitTimeInSeconds`, which is defaulted to
// 60 seconds.
// The `maxWaitTimeInSeconds` can be changed by setting
// it in the `options` passed to `subscribe()`.
for (const event of events) {
console.log(
`Received event: '${event.body}' from partition: '${context.partitionId}' and consumer group: '${context.consumerGroup}'`
Expand Down
6 changes: 6 additions & 0 deletions sdk/eventhub/event-hubs/src/eventHubConsumerClientModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ export interface SubscriptionEventHandlers {
* The `updateCheckpoint()` method on the context can be used to update checkpoints in the `CheckpointStore`
* (if one was provided to the client). Use this in frequent intervals to mark events that have been processed
* so that the client can restart from such checkpoints in the event of a restart or error recovery.
*
* Note: It is possible for received events to be an empty array.
* This can happen if there are no new events to receive
* in the `maxWaitTimeInSeconds`, which is defaulted to 60 seconds.
* The `maxWaitTimeInSeconds` can be changed by setting
* it in the `options` passed to `subscribe()`.
*/
processEvents: ProcessEventsHandler;
/**
Expand Down