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 toServiceBusClient
- The function to get a sender,
getSender
is renamed tocreateSender
. It will now throw an error
if an open sender already exists on theQueueClient
/SubscriptionClient
. If a previously created
sender was closed, then this will create a new sender. - The function to get a receiver,
getReceiver
is renamed tocreateReceiver
. It will now throw an error
if an open receiver already exists on theQueueClient
/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. UsecreateReceiver
instead and pass thesessionOptions
parameter to provide
sessionId
and the duration until which you want to lock the session. receive
andreceiveBatch
functions on the reciever are renamed toregisterMessageHandler
and
receiveMessages
renewLock
on the receiver is renamed torenewMessageLock
. In case of receiver from sessions,
this is renamed torenewSessionLock
.- 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 nowServiceBusClient
), 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 thecreateFromAadTokenCredentials
function.- Typescript: Replace
import * from "ms-rest-azure";
withimport * from "@azure/ms-rest-nodeauth";
- Javascript: Replace
require("ms-rest-azure")
withrequire("@azure/ms-rest-nodeauth")
- Typescript: Replace
Bug fixes
- Fixed Bug 1611 where we could not receive
more than 2047 messages in a single receiver when inReceiveAndDelete
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.