github Azure/azure-sdk-for-js @azure/service-bus_1.0.0-preview.2

latest releases: @azure-rest/maps-search_2.0.0-beta.2, @azure-rest/maps-geolocation_1.0.0-beta.4, @azure-rest/maps-render_2.0.0-beta.1...
5 years ago

1.0.0-preview.2

Breaking Changes

The second preview of the @azure/service-bus library has the below breaking changes from the previous
version:

Name changes

Some of our classes and functions have undergone a naming change to better describe what they are
meant to do.

  • The Namespace class is renamed to ServiceBusClient
  • The function to get a sender, getSender is renamed to createSender. It will now throw an error
    if an open sender already exists on the QueueClient/SubscriptionClient. If a previously created
    sender was closed, then this will create a new sender.
  • The function to get a receiver, getReceiver is renamed to createReceiver. It will now throw an error
    if an open receiver already exists on the QueueClient/SubscriptionClient. If a previously created
    receiver was closed, then this will create a new receiver.
  • The function to get a receiver for a session enabled Queue/Subsciption, getSessionReceiver is no
    longer supported. Use createReceiver instead and pass the sessionOptions parameter to provide
    sessionId and the duration until which you want to lock the session.
  • receive and receiveBatch functions on the reciever are renamed to registerMessageHandler and
    receiveMessages
  • renewLock on the receiver is renamed to renewMessageLock. In case of receiver from sessions,
    this is renamed to renewSessionLock.
  • A third way of receiving messages is introduced on the receiver via getMessageIterator function
    which returns an async iterator over messages.

Authentication

  • If you have been using the createFromAadTokenCredentials function to create an instance of the
    Namespace class (which is now ServiceBusClient), you will now need to use the
    @azure/ms-rest-nodeauth
    library instead of ms-rest-azure library to create
    the credentials that are needed by the createFromAadTokenCredentials function.
    • Typescript: Replace import * from "ms-rest-azure"; with import * from "@azure/ms-rest-nodeauth";
    • Javascript: Replace require("ms-rest-azure") with require("@azure/ms-rest-nodeauth")

Bug fixes

  • Fixed Bug 1611 where we could not receive
    more than 2047 messages in a single receiver when in ReceiveAndDelete mode.
  • Fixed Bug 1098 where precision was lost
    on the messageId when a number is passed.
  • A network connection lost error is now treated as retryable error. A new error with name ConnectionLostError
    is introduced for this scenario which you can see if you enable the logs.
  • When recovering from an error that caused the underlying AMQP connection to get disconnected,
    rhea reconnects all the older AMQP links on the connection
    resulting in the below 2 errors in the logs. We now clear rhea's internal map to avoid such reconnections.
    We already have code in place to create new AMQP links to resume send/receive operations. Fixes
    Bug 1268
    • InvalidOperationError: A link to connection '.....' $cbs node has already been opened.
    • UnauthorizedError: Unauthorized access. 'Listen' claim(s) are required to perform this operation.

Don't miss a new azure-sdk-for-js release

NewReleases is sending notifications on new releases.