You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdk/eventhub/event-hubs/migrationguide.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,16 @@ to migrate their application to V5 of the same library.
5
5
6
6
For users new to the JavaScript SDK for Event Hubs, please see the [readme file for the @azure/event-hubs package](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/eventhub/event-hubs/README.md).
7
7
8
+
## Migration benefits
9
+
10
+
A natural question to ask when considering whether or not to adopt a new version or library is what the benefits of doing so would be. As Azure has matured and been embraced by a more diverse group of developers, we have been focused on learning the patterns and practices to best support developer productivity and to understand the gaps that the JavaScript client libraries have.
11
+
12
+
There were several areas of consistent feedback expressed across the Azure client library ecosystem. One of the most important is that the client libraries for different Azure services have not had a consistent approach to organization, naming, and API structure. Additionally, many developers have felt that the learning curve was difficult, and the APIs did not offer a good, approachable, and consistent onboarding story for those learning Azure or exploring a specific Azure service.
13
+
14
+
To try and improve the development experience across Azure services, including Event Hubs, a set of uniform [design guidelines](https://azure.github.io/azure-sdk/general_introduction.html) was created for all languages to drive a consistent experience with established API patterns for all services. A set of [TypeScript & JavaScript specific guidelines](https://azure.github.io/azure-sdk/typescript_introduction.html) was also introduced to ensure that these libraries have a natural and idiomatic feel. Further details are available in the guidelines for those interested.
15
+
16
+
The new version 5 of the Event Hubs library provides the ability to share in some of the cross-service improvements made to the Azure development experience, such as using the new `@azure/identity` library to share a single authentication between clients and a unified diagnostics pipeline offering a common view of the activities across each of the client libraries.
17
+
8
18
## General changes
9
19
10
20
Version 5 of the `@azure/event-hubs` package is a result of our efforts to
Copy file name to clipboardExpand all lines: sdk/servicebus/service-bus/migrationguide.md
+80-22Lines changed: 80 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,33 +1,84 @@
1
1
# Guide to migrate from @azure/service-bus v1 to v7
2
2
3
-
This document is intended for users that would like to try out preview 8
4
-
for @azure/service-bus. As the package is in preview, these details might
5
-
change as the package is developed before its final release.
3
+
This guide is intended to assist in the migration from version 1 of the Service Bus client library `@azure/service-bus` to version 7 of the same library. It will focus on side-by-side comparisons for similar operations between the two packages.
6
4
7
-
## General changes
5
+
Familiarity with the version 1 of the `@azure/service-bus` library is assumed. For those new to the Service Bus client library for JavaScript, please refer to the [README](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/servicebus/service-bus/README.md) and [Service Bus samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/servicebus/service-bus/samples) for the `@azure/service-bus` library rather than this guide.
8
6
9
-
Version 7 of `@azure/service-bus` provides some "under-the-hood" changes
10
-
by standardizing on common infrastructure with `@azure/event-hubs`. This change
11
-
brings this package in line with the [Azure SDK Design Guidelines for Typescript](https://azure.github.io/azure-sdk/typescript_introduction.html#design-principles).
7
+
## Migration benefits
12
8
13
-
## API changes from V1 to V7
9
+
A natural question to ask when considering whether or not to adopt a new version or library is what the benefits of doing so would be. As Azure has matured and been embraced by a more diverse group of developers, we have been focused on learning the patterns and practices to best support developer productivity and to understand the gaps that the JavaScript client libraries have.
14
10
15
-
### Creating ServiceBusClient
11
+
There were several areas of consistent feedback expressed across the Azure client library ecosystem. One of the most important is that the client libraries for different Azure services have not had a consistent approach to organization, naming, and API structure. Additionally, many developers have felt that the learning curve was difficult, and the APIs did not offer a good, approachable, and consistent onboarding story for those learning Azure or exploring a specific Azure service.
16
12
17
-
-`ServiceBusClient` can now be constructed using new(). The static methods to
18
-
construct it have been removed.
13
+
To try and improve the development experience across Azure services, including Service Bus, a set of uniform [design guidelines](https://azure.github.io/azure-sdk/general_introduction.html) was created for all languages to drive a consistent experience with established API patterns for all services. A set of [TypeScript & JavaScript specific guidelines](https://azure.github.io/azure-sdk/typescript_introduction.html) was also introduced to ensure that these libraries have a natural and idiomatic feel. Further details are available in the guidelines for those interested.
19
14
20
-
In V1:
15
+
The new version 7 of the Service Bus library provides the ability to share in some of the cross-service improvements made to the Azure development experience, such as using the new `@azure/identity` library to share a single authentication between clients and a unified diagnostics pipeline offering a common view of the activities across each of the client libraries.
In the interest of simplifying the API surface we've made a single top level client called `ServiceBusClient`, rather than one for each of queue, topic, and subscription. This acts as the single entry point in contrast with multiple entry points from before. You can create senders and receivers from this client to the queue/topic/subscription/session of your choice and start sending/receiving messages.
22
+
23
+
#### Approachability
24
+
25
+
By having a single entry point, the `ServiceBusClient` helps with the discoverability of the API as you can explore all available features through methods from a single client, as opposed to searching through documentation or exploring namespace for the types that you can instantiate. Whether sending or receiving, using sessions or not, you will start your applications by constructing the same client.
26
+
27
+
#### Consistency
28
+
29
+
We now have methods with similar names, signature and location to create senders and receivers. This provides consistency and predictability on the various features of the library.
30
+
31
+
### New features
32
+
33
+
We have a variety of new features in the version 7 of the Service Bus library.
34
+
35
+
- A new `ServiceBusAdministrationClient` to perform operations like create/get/list/update/delete on queues/topics/subscriptions/rules. These were already available as part of a separate package `@azure/arm-servicebus` that uses Azure Resouce Manager APIs but had the drawback of not supporting connection strings.
36
+
- Ability to configure the retry policy used by the operations on the client, sender and receivers.
37
+
- Ability to cancel async operations on the client, sender and receivers using the abort signal from `@azure/abort-controller`
38
+
39
+
### Client constructors
40
+
41
+
While previously, you would use the static method `createFromConnectionString` on the client to create it using connection string, now you can use the client constructor directly.
While previously, you would use the static method `createFromAadTokenCredentials` on the client to create it using Azure Active Directory, now you can use the new [@azure/identity](https://www.npmjs.com/package/@azure/identity) library to share a single authentication solution between clients of different Azure services.
-`createSessionReceiver()`method is now split into two async methods `acceptSession()` and `acceptNextSession()`
127
+
-The `createReceiver()`overload that took session options is replaced by two async methods `acceptSession()` and `acceptNextSession()`
77
128
- The promise returned by these methods is resolved when a receiver link has been initialized with a session in the service.
78
-
- Prior to v7`createSessionReceiver()` worked using lazy-initialization, where the
129
+
- Prior to v7, `createReceiver()` worked using lazy-initialization, where the
79
130
receiver link to the session was only initialized when the async methods on the `ServiceBusSessionReceiver`
80
131
were first called.
81
132
@@ -108,6 +159,13 @@ brings this package in line with the [Azure SDK Design Guidelines for Typescript
108
159
});
109
160
```
110
161
162
+
### Settling messages
163
+
164
+
Previously, the methods to settle messages (`complete()`, `abandon()`, `defer()` and `deadLetter()`) were on the messages themselves.
165
+
These have been moved to the receiver in the new version, take the message as input and have the `Message` suffix in their name.
166
+
The idea is to have the message represents just the data and not have the responsibility of any operation on the service side.
167
+
Additionally, since a message cannot be settled if the receiver that was used to receive it is not alive, tying these operations to the receiver drives the message home better.
168
+
111
169
### Rule management
112
170
113
171
- The add/get/remove rule operations on the older `SubscriptionClient` have moved to the new `ServiceBusAdministrationClient` class which will be supporting
0 commit comments