Граф коммитов

1124 Коммитов

Автор SHA1 Сообщение Дата
Jeremy Meng d5e4636c91
[ServiceBus] add delay between infinite retry cycles (#20316)
* [ServiceBus] add delay between infinite retry cycles

Errors that are not retryable will be re-thrown out of the normal retry() call.
However, we don't have any delay before restarting the retry cycle.

This PR adds a delay before continuing the infinite retry cycles.

* Add a test and update changelog

also fixed the issue where we don't use `maxRetryDelayInMs` in Fixed retry
mode.

* Address CR feedback

* Update sdk/servicebus/service-bus/CHANGELOG.md

Co-authored-by: Ramya Rao <ramya.rao.a@outlook.com>

* Revert max delay limit in Fixed retry mode

as the setting only applies to Exponential retry mode.

Co-authored-by: Ramya Rao <ramya.rao.a@outlook.com>
2022-02-11 18:11:22 -08:00
Wenjie Yu(MSFT) f9f36200d5
Update service bus to enable live testing in sovereign clouds for multiple services (#20248) 2022-02-09 10:06:12 -08:00
Jeremy Meng 6be39472ec
[ServiceBus] Prepare for February 2022 release (#20239)
* update version number
* update CHANGLOG
2022-02-07 17:10:25 -08:00
Jeremy Meng 2b2b9a4b52
[ServiceBus] Fix an issue where user error handler is not called (#19189)
when subscribing to a valid topic but an invalid or disabled subscription. Issue https://github.com/Azure/azure-sdk-for-js/issues/18798

The problem is that in these cases, the service accepts our client's cbs claim negotiation, and the receiver link is
created. The [client receiver enters](14099039a8/sdk/servicebus/service-bus/src/core/streamingReceiver.ts (L539))
the `retryForeverFn` to call `_initAndAddCreditOperation()`, where the following

```ts
  await this._messageHandlers().postInitialize();
  this._receiverHelper.addCredit(this.maxConcurrentCalls);
```

will return successfully, despite that the fired-and-forgot `addCredit()` call would later leads to
`MessagingEntityDisabled` or `MessagingEntityNotFound` errors in the underlying link. Since there's no errors thrown in
our retry-forever loop, the `onErrors()` [callback](14099039a8/sdk/servicebus/service-bus/src/core/streamingReceiver.ts (L541))
is not invoked. It is one place where the user error handler is called.

Because of the error, the link is detatched. We have code to re-establish the link when errors happen, so we call
`_subscribeImpl()` where the `retryForeverFn()` is called again. This goes on in an endless loop.

We used to invoke user error handler and would not attempt to re-establish connections when errors are considered
non-retryable. In PR #11973 we removed the classification of errors that `subscribe()` used and instead continues to
retry infinitely. We also removed the code to invoke user error handler. This PR adds code to invoke the user error
handler in `_onAmqpError()` so users have a chance to stop the infinite loop.

There's another problem. When users call `close()` on the subscription in their error handler,
`this._receiverHelper.suspend()` is called to suspend the receiver. However, when re-connecting we call
`this._receiverHelper.resume()` again in `_subscribeImpl()`. This essentially reset the receiver to be active and we
will not abort the attempt to initialize connection

14099039a8/sdk/servicebus/service-bus/src/core/streamingReceiver.ts (L574-L579)

To fix it, this PR moves the `resume()` call out. It is supposed to only called to enable receiver before
subscribing. It should not be called when we try to re-connect.

* Update ref doc on the receiver subscribe error handler

* Apply suggestions from code review

Co-authored-by: Ramya Rao <ramya.rao.a@outlook.com>

* Bring back processError() call in _onSessionError() callback

* Clarify that we retry on all errors when streaming

and link to ref doc on service bus errors.

* Bring back comments for resume() call

Also fix linting issue. The linter insists "@" in ts-doc should be escaped.

The url still works after adding "\"

* Re-remove comments

Co-authored-by: Ramya Rao <ramya.rao.a@outlook.com>
2022-02-07 11:10:09 -08:00
Jeremy Meng 35757be24f
[core-amqp] set the max listener limit to 1000 for sender and receiver (#20088)
NodeJS would issue warning if the number of disconnected listeners on an event
emitter exceeds 10. When many sessions on a connection are closed but the
removal of the listener hasn't caught up, we will see this warning because the
default limit of 10 in NodeJS is too low. The disconnected listeners DO get
removed eventually in our code.

We already do this for senders created in Service Bus. This PR increase the
limit to 1000 for senders and receivers created off
`ConnectionContextBase.connection` so that the limites apply to both Service Bus
and Event Hubs.

* EH and SB no longer need to set max listener limit.

For Issue https://github.com/Azure/azure-sdk-for-js/issues/12161
2022-02-01 17:45:43 -08:00
Will Temple 212f4f4456 Squashed commit of the following:
commit dcb5df3fc8
Merge: 356a32c63 6739271b8
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 28 17:22:23 2022 -0500

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit 356a32c63f
Merge: 6527b2813 b88c0bae2
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 28 16:51:32 2022 -0500

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit 6527b2813f
Merge: db7197b84 55ad30951
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 28 16:13:56 2022 -0500

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit db7197b84b
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 28 11:03:50 2022 -0500

    Enable communication-phone-numbers browser tests

commit 9336dc195f
Merge: 097c9d2bc 7ea04a838
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 27 16:17:54 2022 -0500

    Merge branch 'witemple-msft/rollup2' of github.com:Azure/azure-sdk-for-js into witemple-msft/rollup2

commit 097c9d2bc5
Merge: a022f51bd 9ef90e433
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 27 16:17:29 2022 -0500

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit 7ea04a8388
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 26 17:00:14 2022 -0500

    Update common/tools/dev-tool/src/config/rollup.base.config.ts

    Co-authored-by: Harsha Nalluru <sanallur@microsoft.com>

commit a022f51bde
Merge: 64599af3a c7024562e
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 26 16:42:10 2022 -0500

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit 64599af3a3
Merge: bdd4bcac1 0c4d2af1f
Author: Will Temple <witemple@microsoft.com>
Date:   Tue Jan 25 17:29:58 2022 -0500

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit bdd4bcac15
Merge: e834674c9 97b77df56
Author: Will Temple <witemple@microsoft.com>
Date:   Tue Jan 25 11:26:58 2022 -0800

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit e834674c93
Author: Will Temple <witemple@microsoft.com>
Date:   Tue Jan 25 11:19:29 2022 -0800

    fixed schema-registry-avro

commit 26425ecf4c
Author: Will Temple <witemple@microsoft.com>
Date:   Mon Jan 24 12:53:58 2022 -0800

    Remove util dependency from monitor-query

commit 50beb01555
Author: Will Temple <witemple@microsoft.com>
Date:   Mon Jan 24 14:36:30 2022 -0500

    Removed dangling 'util' dependency

commit d28baf05e5
Author: Will Temple <witemple@microsoft.com>
Date:   Mon Jan 24 12:38:56 2022 -0500

    Make warning inhibitors work on Windows

commit 5c4c828a10
Author: Will Temple <witemple@microsoft.com>
Date:   Mon Jan 24 08:31:07 2022 -0800

    Fixed recorder build:test

commit 81a9d6d65b
Merge: cc7f21248 2144ad4eb
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 15:16:24 2022 -0800

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit cc7f212480
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 15:16:08 2022 -0800

    iot-device-update-rest: migrated

commit 88212d2d80
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 14:13:51 2022 -0800

    keyvault-keys: disable node polyfill

commit 3c1302b09a
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 14:10:17 2022 -0800

    keyvault-admin: disabled browser node polyfill

commit 818cf063c2
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 13:35:29 2022 -0800

    Add basePath configuration to shared script config, inhibit empty warnings from node-resolve

commit 8d187890fe
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 12:15:58 2022 -0800

    Removed errant rollup.config.js entries

commit d4833d4914
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 11:47:45 2022 -0800

    Remove my launch config

commit e63d4e5163
Merge: 37cb4bcf5 d9fe26483
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 11:45:31 2022 -0800

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit 37cb4bcf56
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 21 11:44:20 2022 -0800

    Added shim plugin for source maps

commit 98579cc73f
Merge: 9132065dc e3db6c418
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 20 09:44:42 2022 -0800

    Merge remote-tracking branch 'upstream/main' into witemple-msft/rollup2

commit 9132065dc2
Author: Will Temple <witemple@microsoft.com>
Date:   Fri Jan 14 14:39:32 2022 -0500

    Changed weird regex to path.split.join

commit 9c20ebb570
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 17:25:21 2022 -0500

    Removed communication-chat browser test config, as it's not needed

commit 2a8364d387
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 17:06:02 2022 -0500

    Deleted rollup.config.js for packages on the shared script.

commit 3fc9575933
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 17:01:31 2022 -0500

    template: removed rollup

commit 85d7050081
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 16:54:55 2022 -0500

    synapse: silence rollup output

commit ae9f7a6acb
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 16:30:53 2022 -0500

    Some updates to the bundle command

commit 11cee51f6a
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 16:30:33 2022 -0500

    Migrate more packages to shared rollup script

commit 0c4d89c8f4
Merge: f1ccb033a 78f849db7
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 13:00:13 2022 -0500

    Merge remote-tracking branch 'upstream/main' into dev-tool/rollup2

commit f1ccb033ab
Author: Will Temple <witemple@microsoft.com>
Date:   Thu Jan 13 12:11:27 2022 -0500

    [dev-tool] Add rollup-plugin-polyfill-node

commit 1a8ec9b1a2
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 19:07:43 2022 -0500

    preferBuiltins: false for browser

commit fe81f4ce0c
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 18:20:38 2022 -0500

    arm-compute: fix new warning

commit a75eca0064
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 16:20:54 2022 -0500

    Fixed build error in dev-tool

commit d890a897fd
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 16:18:36 2022 -0500

    Resoved merge conflict

commit a64fa41b34
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 16:12:16 2022 -0500

    Remove mixed rollup commands, leaving only rollup.test.config.js

commit f159571fd0
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 14:43:55 2022 -0500

    Remove all rollup dependencies

commit 65170145b1
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 14:11:28 2022 -0500

    Remove ordinary rollup commands.

commit f43cc70494
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 12:48:19 2022 -0500

    Removed configs that opt-out of browser bundles

commit 24357be603
Merge: 86250f0ab 20df85cb7
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 12:31:49 2022 -0500

    Merge remote-tracking branch 'upstream/main' into dev-tool/rollup2

commit 86250f0ab2
Merge: 26c241e6a 8dcc09499
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Jan 12 12:27:43 2022 -0500

    Merge remote-tracking branch 'upstream/main' into dev-tool/rollup2

commit 26c241e6ac
Merge: a0a98eeba 12b194101
Author: Will Temple <witemple@microsoft.com>
Date:   Tue Dec 14 18:37:30 2021 -0500

    Merge remote-tracking branch 'upstream/main' into dev-tool/rollup2

commit a0a98eeba2
Author: Will Temple <witemple@microsoft.com>
Date:   Tue Dec 14 17:39:12 2021 -0500

    Make consistent

commit c8f6ffeb3f
Author: Will Temple <witemple@microsoft.com>
Date:   Tue Dec 14 17:29:05 2021 -0500

    Migrate template

commit d56bcc5e4b
Author: Will Temple <witemple@microsoft.com>
Date:   Wed Dec 8 11:46:16 2021 -0500

    [dev-tool] Add "bundle" command
2022-01-28 17:26:28 -05:00
Timo van Veenendaal 99f2b37542
[Perf tests/service-bus-track-1] Add batch receive perf tests for Service Bus Track 1 (#19790)
**Packages impacted by this PR:**

- `@azure-tests/perf-service-bus-track-1`

**Issues associated with this PR:**

- #18982

**Describe the problem that is addressed by this PR:**

Add a test for receiveBatch using the track 1 service bus SDK in line with what we already have for the track 2 SDK

**Provide a list of related PRs** _(if any)_
- #18811
2022-01-20 14:35:57 -08:00
Maor Leger b200156b18
[eventgrid][servicebus] - Update tests to reflect tracingPolicy changes (#19893)
**Checklists** 
- [x] Added impacted package name to the issue description

**Packages impacted by this PR:** 
@azure/event-grid, @azure/service-bus

**Describe the problem that is addressed by this PR:**
In order to conform to the OTel spec and allow for easier aggregations we
updated tracing policy to name the span `HTTP <method>` instead of `<path>`.
Unfortunately we missed a few tests, so this updates those tests to reflect the
core changes.

While editing these tests, I realized I never added CHANGELOG entries for the original
change. This PR addresses that as well.

**Provide a list of related PRs**_(if any)_
#19838

Resolves #19887
Resolves #19885
2022-01-18 11:29:38 -08:00
Deyaaeldeen Almahallawi 0288d65afa
Upgrade downlevel-dts to latest (#19762) 2022-01-11 20:00:46 +00:00
Jonathan Cárdenas c317dba91e
Update prettier dev-dependency to v2.5.1 in Service Bus (#19576)
* Update prettier version

* Format files

* Format perf-tests
2022-01-03 18:33:37 -06:00
Harsha Nalluru dc8b6da618
[Recorder] Manipulate the `retry-after` header to have "0" value for playback (#19501)
* base code

* 'Retry-After',
  '0',

  manual replacements

* setDefaultRetryAfterIntervalInNockFixture

* setDefaultRetryAfterIntervalInNockFixture

* changelog

* changelog

* docs

* docs

* 19501

* Update sdk/test-utils/recorder/test/node/utils.spec.ts

* Format

* Update recordings to have retry-after value of 0

and remove some 202 responses

Co-authored-by: Jeremy Meng <yumeng@microsoft.com>
2022-01-03 23:31:35 +00:00
Jeremy Meng 479234a3a6
[ServiceBus][Test] Fix Min-Max test build failure (#19600)
* [ServiceBus][Test] Fix Min-Max test build failure

With `@types/long` min version of `4.0.0` we got compilation error

```
Namespace 'Long' has no exported member 'Long'.
```

version `4.0.1` fixes this.

* Update version for event hubs too
2021-12-30 17:06:50 -08:00
Jeremy Meng 61528a2afb
[ServiceBus][TestReliability] Increase timeout when expecting an error (#19509)
for non-existing queue.

When this test is running on China Cloud on a Mac build agent, it gets the
expected error except that it takes a little more than 3 seconds for the error
to come back.

This PR increases the timeout to 5 seconds.
2021-12-27 11:17:52 -08:00
Jeremy Meng 1f237f2493
[ServiceBus][Test] fix unstable tests that verify message state (#19357)
* [ServiceBus][Test] fix unstable tests that verify message state

The test messages we create have `scheduledEnqueueTimeUtc` set. Most of the time
messages received from the service have "active" state, but occasionally have
"scheduled" state due to the set property, thus failing the assertion.

This PR updates the check to check for either "active" or "schedule". In
addition, a test is added for "active" state where the `scheduledEnqueueTimeUtc`
property is removed before sending the message.

Also shown in the failing pipeline that when the test failed, the message wasn't
removed because `receiver.completeMessage()` is not called. The lingering
message caused the next test to fail. While updating the tests I also moved the
cleanup step before assertions so the message should always be removed.

* Undo changes to pipeline

* Address CR feedback

* Disable linting rule

* Remove an unstable assertion on message state.
2021-12-17 20:25:09 +00:00
Ramya Rao 986a28c8d9
Update version for ws (#19382)
Resolves #17075

This PR updates the version of ws from v7 to v8
The breaking changes in the changelog do not affect the way we use it. See https://github.com/websockets/ws/releases/tag/8.0.0
Chose to go with `^8.2.0` to match the version being used by `@azure/web-pubsub`
2021-12-15 23:53:46 +00:00
Azure SDK Bot cbc5e30876
Post release automated changes for azure-arm-servicebus (#19375) 2021-12-15 15:51:06 -08:00
colawwj 7cb905343a
servicebus-track2-ga (#19316) 2021-12-15 12:10:23 +08:00
Ramya Rao 91e3627b7f
Update mocha-junit-reporter (#19309)
* Update mocha-junit-reporter

* rush update
2021-12-14 09:05:13 -08:00
Ramya Rao 5deb6ced31
Remove the docs script from packages (#19307)
As discussed in #17076, we no longer have the need for the `docs` script in each of our packages. This PR removes this script and the related dev dependency on typedoc
2021-12-14 01:30:46 +00:00
Ramya Rao 6c12ef4659
Update nyc to v15 (#19248)
This PR makes the following updates regarding the `nyc` dependency
- Update to v15 from v14 across all packages
- Updates to `@azure/monitor-opentelemetry-exporter` as it failed to run the tests with the updated nyc. 
     - Update the test scripts to use the js files in the dist-esm folder like all other packages instead of using the ts-node plugin.
     - Update one of the tests for `@azure/monitor-opentelemetry-exporter` to use the right path for package.json file now that the tests are being run from the dist-esm folder.

Random set of live tests were triggered from this PR to ensure that nyc works as expected.
The failure for data-tables is an unrelated service side issue

Resolves #19232
2021-12-13 23:43:51 +00:00
Maor Leger ef16743361
[service-bus / eventhubs] - Fix browser tests (#19244)
## What

- Patch service-bus and event-hubs' rollup config with custom plugins that are required for test runs
- Replace `assert` with `chai`

## Why

We tried to use the shared rollup config across packages but unfortunately service-bus event-hubs are and will likely remain a special case due to the various dependencies it pulls in. We identified a few fixable issues but there are some
that will not be easily resolved.

So, working with Will we decided a reasonable compromise is to use the shared config but patch the plugins so that they
match what they were before the recent changes.

In passing, I am also removing any imports of the `assert` module as that has been removed and the tests are failing. So 
this should fix that as well.
2021-12-11 16:55:14 -08:00
Jeremy Meng 3bdb490edd
[ServiceBus] Add optional boolean `skipParsingBodyAsJson` option (#18692)
* [ServiceBus] Add optional boolean `skipParsingBodyAsJson` option

to `ReceiveMessagesOptions`, `SubscribeOptions`, and
`ServiceBusSessionReceiverOptions`. This allows users to control whether the SDK
should skip parsing message body as Json object. By default the SDK will attempt
parsing message body as Json object.

While updating code, I also fixed sample unit test which is using out-dated
paths thus not finding any sample code files, and removed two `await` that are
redundant.

Resolves #18630

* Add optional `skipParsingBodyAsJson` boolean property

to `ServiceBusReceiverOptions` and remove those on `ReceiveMessagesOptions` and
`SubscribeOptions`

* Remove commented code that was trying to decode again

but the message body is already decoded, and _rawAmqpMessage is assigned in
`fromRheaMessage()`

* Remove double decoding

message.body has been decoded already above by `fromRheaMessage()` call.

* Update CHANGELOG and package version

* Add comments

* Update sdk/servicebus/service-bus/CHANGELOG.md

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>
2021-12-10 19:10:46 +00:00
Ramya Rao ec74a37f22
Avoid pointing to docs that are misleading about API deprecation (#19081) 2021-12-09 22:19:14 -08:00
Maor Leger 3c97db3a18
[rollup] - Fix bug in circular dependency warning suppression (#19012)
## What

- Fix incorrect logic when suppressing chai's circular dependency warnings
- Move to the common dev-tool configuration where possible

## Why

This is a longstanding issue that we have, where an incorrect logic was copy-pasted to other places. I figured while cleaning this up that any package I touch can just convert over to the shared dev-tool configuration. Where I was unable
to do that, I just fixed this bug to avoid too many changes in one PR.

Fixes #14292
Resolves #17818 
Resolves #17816 
Resolves #17815 
Resolves #17814 
Resolves #17813 
Resolves #17810
2021-12-09 11:00:32 -08:00
Jeremy Meng b7638dcaf4
[ServiceBus] add `state` property to `ServiceBusReceivedMessage` (#18938)
It can be one of the three `ServiceBusMessageState` values: `"active"`, `"deferred"`, or `"scheduled"`.

Several tests are updated to verify the message state property.
2021-12-06 16:27:57 -08:00
Harsha Nalluru 46164b919c
[Perf Framework] BatchPerfTest & Service Bus Receive Batch perf test (#18811)
* clean up old scripts

* tests -> perfTest

* base, event, batch perf test classes

* program.ts

* incorrect comment

* postSetup and preCleanup

* ParsedPerfOptions<TOptions = Record<string, unknown>> and related updates

* remove ! from options

* MockReceiverTest

* import "@azure/abort-controller" at perf classes

* BatchReceiveTest

* remove !

* changelog

* receiveBatch test

* remove aborter

* docs

* BatchSendTest

* receiveMessages

* no need of timer

* - Adds `PerfTestBase` and `BatchPerfTest`.

* lint fixes

* format

* remove unnneded abstract duplicates

* Update sdk/servicebus/perf-tests/service-bus/test/receiveBatch.spec.ts

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/servicebus/perf-tests/service-bus/test/receiveBatch.spec.ts

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/CHANGELOG.md

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/CHANGELOG.md

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/CHANGELOG.md

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/CHANGELOG.md

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/src/batchPerfTest.ts

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/src/options.ts

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/src/perfTest.ts

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/test-utils/perf/src/perfTest.ts

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* just a comment

* just a comment

* more comments

* stylize

* better Type

* SBTest extends BatchPerfTest

* run the tests with this command

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
2021-12-06 15:10:18 -08:00
Jonathan Cárdenas 8f37a2d9e9
Remove assert dev dependency (#18935) 2021-12-02 19:14:30 -08:00
Ben Broderick Phillips 595c4c8c8b
[stress, servicebus] Update dependency version. Remove/rename old deployment files (#18929) 2021-12-02 19:28:21 -05:00
Harsha Nalluru b3838aa0dd
[Stress Tests] error as Error - Fix build failure (#18911)
* error as Error

* exception instanceof Error

* missed it!
2021-12-02 01:34:48 +00:00
Jeremy Meng 035fa8a8d9
[ServiceBus] Fix linter errors and enable linting (#18670)
* [ServiceBus] Enable linting

* Fixing most linting errors in tests

* Fix more linting errors in src

* Disable errors

- for namespace
- parameter of `any`

* make key const and value mutable

* Add `.catch()` block for promise

* address CR feedback

* format

* Delete test input of undefined ruleOptions for createRule() test

* Use different overloads of `crateRule()`

* Update to the new rule name

* in browser, the error caught doesn't have message property!

AssertionError: expecting valid error.message but error is [object CloseEvent]: expected undefined to be truthy
2021-11-25 00:20:22 +00:00
Azure SDK Bot 12459180d3
Post release automated changes for azure-service-bus (#18613) 2021-11-10 00:07:48 +00:00
Harsha Nalluru 7c0b67c307
[Service Bus] Releasing 7.4.0 (#18577) 2021-11-09 19:33:45 +00:00
Jeremy Meng 8752bcfca4
[ServiceBus] Use `Promise.all()` when closing connection context. (#18371)
* Use `Promise.all()` when closing connection context so that closing requests are fired immediately.

* Add CHANGELOG entry
2021-11-04 17:36:40 -07:00
Ramya Rao 727b2e00fc
Remove dependency overrides for Identity (#18474)
Related to #14581

In https://github.com/Azure/azure-sdk-for-js/pull/18463, we updated all samples to use GA of Identity v2
In https://github.com/Azure/azure-sdk-for-js/pull/18470, we updated devDependencies of Identity v2 beta to use Identity v2 GA

This PR removes the dependency overrides put in place for the reason (am guessing) that we wanted tests to use the beta v2 Identity, but not samples

Now that the samples are using v2, we no longer need the dependency overrides
2021-11-01 23:41:57 +00:00
Ramya Rao 8f40cf08d9
Move Identity dependency from v2 beta to v2 GA (#18470) 2021-11-01 15:31:25 -07:00
Ramya Rao 290a6e4d66
Update all samples to use Identity v2 (#18463) 2021-11-01 15:15:54 -07:00
Timo van Veenendaal 7a7d99d271
[Perf Framework] rename perfstress to perf and runAsync to run (#18290)
Reported in #18033.

Basically did a bulk find+replace everywhere. Things _seem_ to be working OK, but wouldn't be surprised if there's something somewhere I've missed, or somewhere where I've replaced something I shouldn't.

I've split the rename of PerfStress -> Perf and runAsync -> run into two commits for ease of review :)
2021-10-23 06:05:56 +00:00
Harsha Nalluru 4cc59c0b2f
[Service Bus] ATOM API - Make service version configurable (#18254)
* ServiceBusAtomAPIVersion

* older API Version is broken

* tests

* rename

* changelog

* getRandomServiceVersion

* remove .only

* address Jeremy's feedback

* serviceVersion comments

* docs

* test with both the api versions

* Donot expose ServiceBusAtomAPIVersion

* test

* doc update
2021-10-21 22:40:16 -07:00
Azure SDK Bot b01fc24700
Post release automated changes for servicebus releases (#18206)
Post release automated changes for azure-arm-servicebus
2021-10-15 09:59:41 +00:00
Hiroshi Yoshioka 1e706fc136
Typo "Typescript"→"TypeScript" (#18141)
https://docs.microsoft.com/en-us/javascript/api/overview/azure/service-bus-readme?view=azure-node-latest
related: "https://github.com/MicrosoftDocs/azure-docs-sdk-node/pull/1287#pullrequestreview-768207375"
@danieljurek  - Thank you for your suggestion.
2021-10-12 10:23:18 -05:00
colawwj ef323b7ffa
track2-version-bump (#18111)
* track2-version-bump

* update

* update
2021-10-09 14:48:41 +08:00
Azure SDK Bot 311a6ac6bd
Post release automated changes for azure-service-bus (#18045) 2021-10-05 19:45:40 +00:00
Harsha Nalluru a8021f568b
[Service Bus] Fix live test failure (#18027)
* changelog

* fix test

* remove .only
2021-10-05 00:33:55 +00:00
Harsha Nalluru c7f39c1754
[Service Bus] Release 7.4.0-beta.1 (#18024)
* changelog

* 7.4.0-beta.1
2021-10-04 23:08:27 +00:00
Harsha Nalluru 0e569b51e1
[Service Bus] Release 7.3.1-beta.1 (#18020) 2021-10-04 15:03:02 -07:00
Harsha Nalluru afff61b21f
[Service Bus] Support MaxMessageSizeInKilobytes (#17953)
* Fix retry handling for Session Not Found errors

* Update sdk/cosmosdb/cosmos/test/internal/session.spec.ts

Co-authored-by: Zachary Foster <zfoster@users.noreply.github.com>

* Update CODEOWNERS for Application Insights (#17055)

* MaxMessageSizeInKilobytes api

* sample,test.env

* API Report

* add tests

* finish the tests

* remove console.log

* arm template

* put .only to test in CI with limited tests

* minor test update

* remove .only, add changelog

* Update sdk/servicebus/service-bus/src/util/constants.ts

Co-authored-by: chradek <51000525+chradek@users.noreply.github.com>

* wrap text - changelog

* maxMessageSizeInKilobytes: 256 by default for Standard namespaces

* Revert "maxMessageSizeInKilobytes: 256 by default for Standard namespaces"

This reverts commit 4f425634b6.

* exclude "maxMessageSizeInKilobytes"

* (Configurable only for Premium Tier Service Bus namespace.)

* Version 7.3.1-beta.1

* update version at more places

* lock file

* Update sdk/servicebus/service-bus/CHANGELOG.md

Co-authored-by: Adam Ling (MSFT) <adam_ling@outlook.com>

* lock file

* non optional in EntityProperties

* api report

Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
Co-authored-by: Zachary Foster <zfoster@users.noreply.github.com>
Co-authored-by: omziv <80668253+omziv@users.noreply.github.com>
Co-authored-by: chradek <51000525+chradek@users.noreply.github.com>
Co-authored-by: Adam Ling (MSFT) <adam_ling@outlook.com>
2021-09-30 18:00:27 -07:00
Maor Leger 9dc6167cf1
Update API Extractor for all packages (#17917)
## What

- Update API Extractor to the latest version (currently 7.18.11)
- Regenerate all API reviews by building all the packages

## Why

This is something we keep bumping into. First, we needed to upgrade API Extractor to allow us to re-export directly from
`@opentelemetry/api`. Then, it looks like we needed this to upgrade TypeScript to 4.4. 

We are way behind on this version, and it's time to upgrade.

## Callouts

How noisy is this?! Here's what's happening - somewhere around 7.9 I think API Extractor improved the way it detects name
collisions with predefined globals. Things like KeyType, Response, etc. 

If there's a clash, the generated API markdown file will rename <Item> to <Item_2> to make the name collision explicit.

Talking to folks on the team, and the poor souls that will be doing API Review approvals, we agreed that doing the upgrade
in one fell swoop is the way to go. 

Resolves #9410
2021-09-30 08:07:26 -07:00
Chidozie Ononiwu (His Righteousness) 23170c9256
Add PoliCheck tool to aggregate report pipeline (#17727)
* Add PoliCheck tool to aggregate report pipeline

* Exclude recordings from policheck run

* Use upper case for folder exclusion

* Fix up policheck issues

* Move CredScan into the Compliance stage

* Fixup policheck issues
2021-09-24 11:23:35 -07:00
chradek e2f6e8d801
remove delay devDependency (#17305)
Resolves #17089

`@azure/abort-controller` doesn't use `delay` in any tests, so easy removal.
`@azure/service-bus` used `delay` for perf tests, but only as a promisified setTimeout. Removed dependency and replaced with a simple delay function.
2021-09-20 16:38:16 +00:00
Jeremy Meng 74f543c776
[Engsys] Suppress credscan reported issues for test constants (#17505)
* Remove leftover recordings whose tests had been deleted

* Move test secrets into file so we can suppress the file, instead of suppressing using the unstable hashes

* Update suppression list
2021-09-14 12:49:16 -07:00
Jeremy Meng 13861173b6
Upgrade dev dependency ts-node to ^10.0.0 (#17323) 2021-09-10 15:38:24 -07:00
Harsha Nalluru 59838aa40d
[Perf Tests] Migrate the older perf test projects to new model - event based SDKs (#17383)
* move to the new structure

* minor edits

* sample.env and readmes

* more changes

* track 2 service-bus looks fine

* track 1 also seems fine

* more fixes

* formatting

* Update sdk/eventhub/perf-tests/event-hubs-track-1/README.md

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>

* Update sdk/eventhub/perf-tests/event-hubs-track-1/README.md

* Apply suggestions from code review

* lock file

* lock file from master

* lock file

* all minor feedback

* more formatting

* remove prebuild

* more care for readmes

Co-authored-by: Daniel Rodríguez <sadasant@users.noreply.github.com>
2021-09-10 10:34:29 -07:00
Azure SDK Bot 838d804c19
Post release automated changes for servicebus releases (#17538)
Post release automated changes for azure-arm-servicebus
2021-09-09 08:32:27 +00:00
colawwj df6fef5611
servicebus-track2 (#17536)
* servicebus-track2

* update
2021-09-09 15:20:14 +08:00
Deyaaeldeen Almahallawi 855ff18195
upgrade buffer to v6 (#17414) 2021-09-01 18:16:24 -04:00
Daniel Rodríguez b8f46a9175
Ensuring that the build script also cleans (#17123)
* [Identity] Ensuring that the build script also cleans

* ...everywhere!

* removing double cleans
2021-08-26 14:25:14 -04:00
Maor Leger f62d5e7a4d
[core] - Remove SpanOptions from the public API (#16984)
## What

- Removes spanOptions from OperationTracingOptions
- Prepares client package for compatibility with both existing and future core-tracing code by adding runtime casts / checks where spanOptions are concerned
- Adds `az.namespace` as an attribute on the current context, ensuring that it is available for tracing policies
- Adds spanOptions as a parameter to `createSpan` allowing customization of a newly created span
- Prepare tracingPolicies for backwards and forwards compatibility at runtime by using spanOptions as well as spanContext to determine the value of az.namespace to set on spans.

**Does NOT upgrade client libraries yet and their API will NOT change until we upgrade**

## Why

spanContext originally existed to be able to shepherd attributes around in order to add them to any child spans. Specifically, we need to add the az.namespace to the outgoing request span. Now that `tracingContext` is available as both a bag of values as well as a container for parenting info, we no longer need spanOptions.

Actually, spanOptions grew to add enums and other elements that caused us pain in the past. See #15285 as an example.

Finally, providing spanOptions as a publicly available option bag means that we are providing ways for consumers to customize our own spans. We don't need that, as we own the spans we create.

But what we still need to provide is a way for our own libraries to customize the spans they produce. By moving spanOptions off of OperationTracingOptions and into a separate parameter in createSpan we can support this.

## Callouts

I tested compatibility here in multiple ways:

1. I changed core-tracing's version to preview.13 so that all libraries will run tests against the new package
2. I then changed it _back_ to 14, so that all libraries will run tests against the old pacakge
3. I packed preview.13 with new bits and installed published packages for a few libraries and manually tested a few scenarios

Resolves #15285 
Resolves #16726
2021-08-24 14:51:37 -07:00
chradek 8c62014904
[service-bus] fix getMessageIterator docs (#16957) 2021-08-24 11:26:40 -07:00
Daniel Rodríguez ea06d10dd3
[Identity] Incrementing the package version (#16908)
* [Identity] Incrementing the package version

* setting samples to the last released version of Identity

* upgraded non-samples to 2.0.0-beta.6

* found a fix for the CI issue
2021-08-18 19:11:14 -04:00
chradek d80e0fec20
[service-bus] supdate long running stress test to use single sender (#16946) 2021-08-17 10:28:27 -07:00
Ben Broderick Phillips ddf47d5602
[stress testing] Update stress-test-addons chart version (#16934) 2021-08-16 14:06:33 -04:00
Ben Broderick Phillips 5d3b6fcb38
[stress testing] Improve dockerfile and ARM template for service bus (#16910)
* [stress testing] Fix service bus dockerfile directory add

* Build service bus stress test arm template with bicep
2021-08-13 13:35:28 -04:00
Ben Broderick Phillips fef5493b6e
Refactor service bus stress tests to use stress test package format (#16689)
* Re-organize eh stress files for stress test layout

* Add service bus stress test helm chart

* First pass generating stress job for each scenario

* Deep copy global template scope in stress test range loop

* Updates and deployment files for service bus stress

* Use base arm template

* fix helm template and docker build

* Final fixes to get service bus stress tests working

* [stress test] Update to use built-in scenario range addon

* [stress test] Minor fixes

* Update stress test program locations

* Run prettier over service bus stress test files
2021-08-13 12:30:28 -04:00
Deyaaeldeen Almahallawi a78a4c8b8f
Upgrade puppeteer dep to ^10.2.0 (#16864) 2021-08-12 01:13:46 +00:00
Ramya Rao a883638aeb
Add missing changelog entries for tracing and ES2017 updates (#16768)
This PR adds missing changelog entries for the times we
- updated tracing dependencies to use the GA version of OpenTelemetry
- updated to target ES2017
2021-08-04 22:11:55 +00:00
Maor Leger 5cd6362fbd
[core] - Align with latest OpenTelemetry implementations (#16347)
## What

- Remove `setTracer`
- Remove `NoOpTracer` and `NoOpSpan`
- Use Otel's APIs where possible (like when creating a no-op)
- Respect AZURE_TRACING_DISABLED environment variable
- Include test support for tracing utilizing OTel's trace API
- Avoid injecting invalid `tracerparent` header fields

## Why

- `setTracer` was added before OTel had their own implementation of a global tracer provider. For consistency with other libraries we should use the global tracer that was registered. It also leaves us out of the business of maintaining caches, global tracers, and other annoying things.
- These are no longer needed, since OTel has a recommended way to wrap a span in a NoOp. And, if no tracer provider was registered, a non-recording tracer  (NoOp) will be created. All managed by OTel
- Finally, AZURE_TRACING_DISABLED is one of the env vars our guidelines say we should support

Resolves #16088
Resolves #15730
Resolves #10205
2021-07-15 08:18:54 -07:00
Azure SDK Bot 8b79455fab
Increment package version after release of azure-service-bus (#16289) 2021-07-14 09:57:38 -07:00
Daniel Rodríguez 773c5b6ed7
[Identity] Increment versions after the recent release (#16342) 2021-07-09 17:32:44 -04:00
Maor Leger f5d75ae2d5
[core] - Remove TestTracer and TestSpan from public API (#16315)
## What

- Move `TestTracer`, `TestSpan`, and `SpanGraph` from @azure/core-tracing to @azure/test-utils

## Why

1. Having a folder called src/**test**/ does not play nicely with defaults generated by tools such as Yarn (specifically Yarn autoclean)
2. These are test support interfaces, and shouldn't be part of our public API anyway - now that we have @azure/test-utils it's the more appropriate location for them

Resolves #16265 
Resolves #16201
Related #13367
2021-07-09 11:11:15 -07:00
Richard Park 121d898e90
[service-bus] Mitigate session-overlap test (#16183)
We have an intermittent issue where we close a session and it releases, but there is a delay (Documented as part of this issue here: [link](https://github.com/Azure/azure-sdk-for-js/issues/14441). We've seen it in our normal live tests (not every time, but often enough to be noted).

I've done two things to make this "better":
- Mitigated the issue so we can still get a decent test signal by making the tests no longer use the same session ID. They didn't actually need to send or receive messages for the test itself (it's just validating that we're adding the right amount of credits) so I simplified the tests.
- Put in some wrapper code to make it simpler to reproduce the issue in the future. It will basically run these session based tests 1000x, which still doesn't _always_ reproduce the issue but can.

As a bonus, there was a `peekMessages()` test that expected that a message that has been sent will immediately be available, which isn't always true (there can still be a delay between "message accepted" and "message receivable"). I've fixed this test by doing a `receiveMessages()` first (which will wait until messages are available), abandoning the message and then doing a peek, which should work more reliably.
2021-07-08 13:22:58 -07:00
Richard Park ff0c7f8bb1
- Fix TS construct that isn't valid JS. (#16242)
- Adjust changelog date.
- Fix sample to not use an invalid JS construct
2021-07-07 00:44:01 +00:00
chradek aec5639eb0
[service-bus] add @types/ws to TypeScript samples package.json (#16238)
Fixes https://github.com/Azure/azure-sdk-for-js/issues/15666

It also turns out the samples depended on the `next` tag for service-bus, which is no longer published on NPM, so this update fixes that issue by depending on the `latest` tag.
2021-07-06 23:31:37 +00:00
bashiMoha dc6059810b
Dispaly links as list (#16117)
* displayed links as  a list rather than a single line

* appconfiguration\Readme:  displayed links as a list rather than a single line

* confidential-ledger-rest/README.md: display links as list

* container-registry/README.md: display links as list

* cosmos/README.md: display links as list

* iot-device-update/README.md: display links as list

* eventgrid/README.md: display links as list

* event-hubs/README.md: display links as list

* eventhubs-checkpointstore-blob/README.md: display links as list

* formrecognizer/README.md: display links as list

* identity/README.md: display links as list

* iot-modelsrepository/README.md: display links as list

* keyvault-admin/README.md: display links as list

* keyvault-certificates/README.md: display links as list

* keyvault-keys/README.md: display links as list

* keyvault-secrets/README.md: display links as list

* ai-metrics-advisor/README.md: display links as list

* mixedreality-authentication/README.md: display links as list

* monitor-query/README.md: display links as list

* purview-catalog-rest/README.md: display links as list

* purview-scanning-rest/README.md: display links as list

* quantum-jobs/README.md: display links as list

* search-documents/README.md: display links as list

* schema-registry/README.md: display links as list

* schema-registry-avro/README.md: display links as list

* service-bus/README.md: display links as list

* storage/storage-blob/README.md: display links as list

* storage-blob-changefeed/README.md: display links as list

* storage-file-datalake/README.md: display links as list

* storage-file-share/README.md: display links as list

* storage-queue/README.md: display links as list

* data-tables/README.md: display links as list

* ai-text-analytics/README.md: display links as list

* video-analyzer-edge/README.md: display links as list

* web-pubsub/README.md: display links as list

* web-pubsub-express/README.md: display links as list

* core-lro/README.md: display links as list

* changed from the word master to main

* changed the word master to main

* another update to the final reandme to change  the word master to main

* Update README.md

fixed a type in the link

* Update sdk/anomalydetector/ai-anomaly-detector/README.md

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>
2021-07-06 12:30:32 -04:00
Richard Park d75f119fd6
[service-bus] Fix message loss issues with peekLock and receiveAndDelete (#15989)
Fixing an issue where we could lose messages or provoke an alarming message from rhea (`Received transfer when credit was 0`)
    
The message loss issue is related to how we trigger 'drain' using 'addCredit(1)'. Our 'receiver.drain; receiver.addCredit(1)' pattern actually does add a credit, which shows up in the flow frame that gets sent for our drain. This has led to occasionally receiving more messages than we intended.
    
The second part of this was that we were masking this error because we had code that specifically threw out messages if more arrived than were requested. If the message was being auto-renewed it's possible for the message to appear to be missing, and if we were in receiveAndDelete the message is effectively lost at that point. That code is now removed (we defer to just allowing the extrra message, should a bug arise that causes that) and we log an error indicating it did happen.
    
The rhea error message appeared to be triggered by our accidentally allowing multiple overlapping 'drain's to occur (finalAction did not check to see if we were _already_ draining and would allow it to happen multiple times). Removing the concurrent drains fixed this issue but I didn't fully investigate why.

Fixes #15606, #15115
2021-06-30 18:43:14 -07:00
Ramya Rao 5a7c129972
Update engines, @types/node to Node.js v12 (#15996) 2021-06-28 15:54:47 -07:00
Ramya Rao b729674427
Update Node.js & browser support in README (#16011) 2021-06-25 16:00:09 -07:00
Maor Leger 5903b7cd3d
[core] - Bump core-http to 2.0.0 and core-lro to 2.0.0 (#15925)
## What

- Update core-http to 2.0.0
- Update core-lro to 2.0.0
- Update packages to use latest version

## Why

This will support our last breaking change for core-tracing, and allow everyone to be on the same minimum version. This will also allow us to target ES2017 across the board.
2021-06-24 12:59:13 -07:00
Chidozie Ononiwu 5f71ecd285 Rename master to main 2021-06-24 09:14:06 -07:00
Richard Park 58b1993990
[service-bus] Fixing issue where links were not removed from our internal cache (#15929)
Today we cache any opened links in the connectionContext. These links should be removed when the link itself is closed but, due to a mismatch in the values, we weren't. 

I've fixed this by just making an abstract method in LinkEntity (the base for all the link types) and just having each link properly remove itself from the cache.

Fixes #15890
2021-06-23 19:00:57 -07:00
Will Temple c7f3a2a70b Replace master with main in homepage links. 2021-06-22 16:09:11 -07:00
Chidozie Ononiwu a64747cf6a Rename hardcoded master links to use main 2021-06-22 15:51:16 -07:00
Richard Park d4d2c75dbd
[service-bus] Closing some open areas where we could mask errors, and fixing flaky tests to be more reliable. (#15761)
Making changes to simplify a flaky test (and hopefully make it more reliable).

The main issue with the 'handle interrupted detach' method was that it relied on too many moving parts to work reliably. We could just eternally loop like we'd expect customers to do, but in the end we have a very simple test we're trying to perform - we want to receive, and while we're in the process of draining, cause a detach and have it early exit and reject/resolve immediately rather than waiting for the timeout.

I reworked the test to make that simpler by just removing the unneeded connection.idle() and just calling directly into the onDetached method. Because it happens prior to rhea even seeing that we're draining we should reliably win that race each time. 

There were a couple of other things changed for this PR as well:
- The max time per test was lowered accidentally. Bringing it back what's been used as the standard time in other libraries
- Fixed a spot in receiveMessages() where, if the link had been closed, we'd falsly return an empty array instead of throwing an exception indicating the link closed. This didn't appear to be related to the bug but it's incorrect and can hide bugs so I'd rather just throw the error than eat the condition and return an empty array. It's rare, but when it does happen the empty array response isn't right either - we're probably in the middle of a connection reset/change event.

Fixes #13461
2021-06-21 10:58:33 -07:00
Maor Leger d0232046bb
[Core] - Move core-tracing to @opentelemetry/api 0.20.0 (#15672)
## What

- Bump @opentelemetry/api to 0.20.0 in @azure/core-tracing
- Move all packages that are on core-http to the next core-tracing version 
- Remove version collision check from the tracer cache

## Why

This is part of our effort to move everyone to OTel 0.20.0 - but we have to stage it due to a transitive dependency and a 
breaking change in OTel. This PR updates core-tracing to use the latest OTel, fixes any breaking changes, and moves 
packages that we can move to the latest version of core-tracing.

Once core-rest-pipeline 1.1.0 is GA'd we'll be able to move the rest of the packages over to the latest core-tracing as well.

Removing the version collision came out of an offline discussion after these changes were reviewed - since it's a common 
source of pain and hasn't added much benefit (tracer conflicts incompatibility was never a problem) we decided to remove 
that logic and always grab a unique symbol per OT compatibility. 

## Callouts

The packages that are already on core-v2 will _not_ be upgraded at this time - we'll coordinate that with the GA of core-rest-pipeline 1.1.0
2021-06-18 15:57:58 -07:00
Jeremy Meng 11e2a4bdd4
Remove IE related doc and tests (#15760)
As we are ending the support for IE 11, this PR remove doc and test logic that
handle IE.

- Remove commented polyfill from karma configs
- Remove IE compatibility section from Stroage README files
- Remove IE specific logic from storage tests.
- Remove Storage TODO comments for IE.

* format

* run format on core-client-rest
2021-06-16 14:20:49 -07:00
Richard Park 2b246bdaca
[service-bus] Flaky test fix - un-awaited abandonMessage() calls cause unrelated tests to fail (#15716)
We had some abandonMessage() calls in atomE2E.ts that were not being await'd on, which meant when they did ultimately fail, it would happen in an unrelated test.

I'm a bit unsure why but it appears that mocha was attributing these failures to these tests, even though they weren't started or a part of them.

As an example: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=943479&view=logs&j=07f0c2bc-806a-58d0-ca0d-069f605ef81d&t=fd27c4cf-da6b-5a51-aa3d-cd45c93f6ef8

(there are other failures in that same build that I'm not entirely are are related, but this part is definitely incorrect and can be fixed).
2021-06-12 01:05:02 +00:00
KarishmaGhiya 18b0c92bbc
Updating identity v2 beta versions for identity tests and reverting to GA version v1 for samples (#15654)
Co-authored-by: Jeremy Meng <jeremy.ymeng@gmail.com>
2021-06-11 14:58:57 -07:00
Deyaaeldeen Almahallawi d3f0285339
[tslib] Upgrade from 2.0 to 2.2 (#15702) 2021-06-11 16:09:45 -04:00
Azure SDK Bot 5c4354f341
Increment package version after release of azure-service-bus (#15673) 2021-06-10 13:27:19 -07:00
Richard Park c300481e7c
[service-bus] Fix autoCompleteMessages help to indicate that it'll both completeMessage() and abandonMessage() (#15658)
Updating doc comment for autoComplete, indicating that it will abandon() if an error is thrown.

The prior text made it sound like it would call complete() no matter what happened, which was confusing.

Fixes #15519
2021-06-10 02:01:00 +00:00
KarishmaGhiya b18ddca6c4
update version of identity for perf tests and samples of service-bus (#15632) 2021-06-09 23:44:17 +00:00
Richard Park e4e9497fa1
[service-bus] Updating changelog with proper date and features for 7.2.0 GA release (#15548)
Updating changelog for 7.2.0 GA release with AMQP body type encoding.
2021-06-09 18:19:26 +00:00
chradek 3866111776
[service-bus] pass abortSignal to link initialization and awaitableSender (#15349)
* [service-bus] pass abortSignal to link initialization and awaitableSender

* [service-bus] add changelog entry

* [core-amqp] remove AsyncLock!

* [service-bus] fix test after the great merge

* npm run format

* fix abort on send after great merge
2021-06-08 20:19:55 -07:00
chradek dec897afb2
[core-amqp][event-hubs][service-bus] Fixes _process of undefined TypeError (#15597)
This PR fixes #13500.

`rhea` 2.0.1 contains the fix to this specific error. We currently use `rhea` 1.x, so there's additional work in this PR to workaround the single breaking change in `rhea`, and the breaking changes in `rhea-promise`.

### rhea breaking change

`rhea` contains 1 breaking change between versions 1.x and 2.x: timestamp types are now deserialized as Date objects instead of numbers. Unfortunately since this changes the way users' data might be deserialized in their service bus messages or event hubs events, we have to convert Date objects back to numbers in our client libraries until we do a major version bump. (Shorter term we can look at using rhea's default behavior behind a flag.)

### rhea-promise breaking changes

Some of the `rhea-promise` APIs that accepted multiple optional positional arguments have been updated to take a single options bag parameter at the end of their method parameter list.

AwaitableSender was also updated so that a timeout is no provided at instantiation. Instead, it must be provided per each `send()` call.

### core-amqp v3
Since core-amqp is being updated to depend on rhea 2.x, core-amqp dependencies will also pull in rhea 2.x transitively.
To ensure that existing versions of event hubs and service bus don't break by deserializing timestamps as Date objects, core-amqp is updated to a new major version: v3. 

Once #15349 is merged, we can also remove `AsyncLock` completely, so I'd like to merge that PR in before releasing the changes in this PR.
2021-06-08 21:23:39 +00:00
Richard Park 2e56a4f08d
[service-bus] Updating samples to fix a few issues: (#15430)
Updating samples to fix a few issues:
- Show the right way to restart your receiver when using sessions (which
don't do automatic retries like non-sessions).
- Some of the samples printed almost too little console output to indicate what
  they were doing or didn't demonstrate the right techniques (asking for multiple
  messages at a time, etc..). Those have been updated as well.

Fixes #14531
2021-05-27 14:38:36 -07:00
Richard Park 1888d8c3cd
[service-bus] getMaxMessages needs to retry if link doesn't initialize (#15409)
getMaxMessages had an edge case where the link being closed just after open would cause us to access a link that was undefined and throw a non-retryable exception.

This PR fixes that by checking that the link is defined, and throwing a retryable exception if it is not.

Fixes #15398
2021-05-25 17:05:45 -07:00
Richard Park 0efa83db98
[service-bus] Remove dead code in MessageSender.sendMessages (#15406)
We always send messages via the 'batch' version of the method now, so the original array-based version with `sendMessages` is no longer used.
2021-05-25 19:48:26 +00:00
Azure SDK Bot ed6f5ebb03
Increment package version after release of azure-service-bus (#15322) 2021-05-20 11:17:14 -07:00
Richard Park 4cf3566d2a
[service-bus] Final work to expose AMQP body type encoding publicly (#15295)
Finishing work to enable AMQP body type encoding

- We completely missed the schedule messages code path. Added, with tests.
- Consolidated the two files of AMQP messaging tests into the `public` branch so we also get min/max testing. Removed all references to non-published interfaces.
2021-05-17 18:54:11 +00:00
Jose Manuel Heredia Hidalgo 5b37cb8953
Update DeviceUpdate and ServiceBus samples to v2 (#15068)
Updating Device Update and Service Bus samples to the v2 workflow
2021-05-14 00:52:52 +00:00
Richard Park 63624ccc3b
[service-bus] Re-enabling the AMQP body type encoding feature. (#15271)
Re-enabling the AMQP body type encoding feature. We disabled this temporarily when we released 7.1.0 and are now re-enabling this in time for our new preview: 7.2.0-beta.1
2021-05-13 21:57:30 +00:00
Azure SDK Bot b82359575f
Increment package version after release of azure-service-bus (#15226) 2021-05-11 13:42:33 -07:00
Richard Park 73d9b00ad8
[service-bus] Update CHANGELOG.md (#15207) 2021-05-11 00:07:42 +00:00
Richard Park e31eb3e7f3
[service-bus] Temporarily disable AMQP body type encoding support for 7.0.6 (#15184)
Disable amqp body type support until we release it in an official 'beta'.

Runtime prevention:
- Prevent isAmqpAnnotatedMessage() from ever returning true (disables all AMQP body type related code paths)
- Fix error message constants so they feature-switch and don't mention AmqpAnnotatedMessage

Compile time prevention:
- Remove AmqpAnnotatedMessage from the public facing types (ServiceBusMessageBatch and ServiceBusSender)

All tests and internals are intact and tests are enabling the code paths internally so tests are still working properly.
2021-05-10 14:25:42 -07:00
Richard Park e2b5a62925
[service-bus] Reliability improvements and testing updates (#15098)
This PR has a few changes in it, primarily to improve our robustness and our reporting:

General reliability improvements:
- Migrates to a workflow that treats subscription start as a retryable entity, rather than just link creation (which is what had previously). 
- It checks and throws exceptions on much more granular conditions, particularly in addCredit
- Error checking and handling has been migrated to be in far fewer spots and to be more unconditional, which should hopefully eliminate any areas where an exception or error could occur but it never gets forwarded or seen.

SDK debugging:
- Adds a new SDK only flag (forwardInternalErrors) which will make it so areas that used to eat errors now can forward them to processError. Prior to this the errors were only logged, but that meant they could be missed. Most of these would probably be considered cosmetic by customers so this is primarly for debugging purposes within the SDK itself.
- The internal `processInitialize` handler has been split into two (still internal) handlers - preInitialize and postInitialize. preInitialize runs before init(), and postInitialize runs after init() but before addCredit. This lets us write more reliable tests. These are not exposed to customers.

Fixes #14535
2021-05-07 20:26:21 -07:00
chradek a9f340c132
[core-amqp][event-hubs] prepare for release (#15080)
Prepares `@azure/core-amqp` v2.3.0 and `@azure/event-hubs` v5.5.1 for release.

/cc @ramya-rao-a
2021-04-29 16:47:37 +00:00
Richard Park 3c1b53fcab
[service-bus] Improvements to stress testers, retarget to kubernetes (#14971)
Target a Kubernetes cluster, rather than ACI!

- Change the logic from being a .js file (which nobody seemed to like) to being a set of bash scripts testBuild.sh to build the conntainer, testRun.sh to actually run the containers + scripts in Kubernetes and testAll.sh to launch every scenario file as a pod in Kubernetes.
- Fixed the stress tests to clarify some boundaries and make it simpler to write a test properly (ie, don't forget to close a client, don't forget to report telemetry or flush, etc..)
2021-04-22 20:41:08 +00:00
chradek 4027106490
[core-amqp][event-hubs] Fix "too much pending tasks" by making acquire lock calls cancellable (#14844)
* [core-amqp] adds defaultCancellableLock

* [core-amqp] make cbs acquireLock call cancellable

* [core-amqp] update CancellableAsyncLock to throw OperationTimeoutError if acquireTimeoutInMs is reached

* [core-amqp] fix eslint errors

* [event-hubs] add timeouts to acquire calls

* pass abortSignal to init/negotiateClaim methods

* update pnpm-lock.yaml

* [core-amqp] make flaky tests not flaky

* [core-amqp] make fields required

* [core-amqp] AcquireOptions -> AcquireLockProperties, add defaultCancellableLock back, remove unneeded code from allSettled helper util

* [core-amqp] parameter rename cleanup

* [event-hubs] add timeout to link initialization calls

* update pnpm-lock.yaml

* [event-hubs] improve timeout to cbsSession.negotiateClaimLock

* [core-amqp] add isOpen() to CbsClient

* [event-hubs] remove unneeded AbortError branch from event hub receiver

* [core-amqp] fix flaky test in node 15

* [event-hubs] use cbs isOpen()

* [core-amqp] add timeout to CbsClient init and negotiateClaim methods

* [event-hubs] pass timeout through to CbsClient init and negotiateClaim methods
2021-04-19 16:57:29 -07:00
Richard Park 343f07eebc
Replace unreliable live test (too timing dependent) with unit test that tests the same logic and should be more reliable. (#14916)
There were two live tests that were basically exercising a small segment of validation code to make sure you can't try to receiveMessages() and subscribe() at the same time. These tests have been flaky in the past, and were really only testing logic so I just migrated them to unit tests instead.
2021-04-16 18:58:07 -07:00
Richard Park 57d8629394
Fixing some issues I introduced in an earlier commit that merged earlier than I meant to: (#14903)
One of my previous PRs merged earlier than the live test execution. Fixing some issues that were remaining:

- the ServiceBusClient in the test wasn't being closed after each test (sessionsRequiredCleanEntityTests.spec.ts is special in that it has to recreate new entities for each test). This is responsible for the current 3+ hour test executions happening in master for SB.
- Removed a stray console.log statement I left in the test.
2021-04-16 02:00:15 +00:00
Richard Park f6228c4834
[service-bus] Fixing session peeking test that was failing randomly. (#14872)
This commit adds in a receiveMessages call to ensure that messages have arrived by the time we actually do our peekMessages() call. Without this, if there is a delay between the message being processed in the queue and it being available for receiving we'll end up in a situation where peekMessages() will return zero messages.

peekMessages goes against an expected sequence number and doesn't wait if there aren't any messages at that moment to receive. receiveMessages() always asks for the current messages and will wait for the expected number to arrive. So by adding peek _after_ receiveMessages() we should be able to get the proper sequence of operations - messages arrive, are available and now we can peek properly.

Fixes #14757
2021-04-15 22:14:43 +00:00
Harsha Nalluru d6e35b88dc
[Service Bus] Filling the gaps for AmqpAnnotatedMessage (#14786)
#14703 missed a few things while translating Annotated message into RheaMessage.
This PR attempts to fill the gaps.
2021-04-15 04:14:28 +00:00
Harsha Nalluru 172df4f99d
[Service Bus] Bug Fix: Unexpected `expiresAtUtc: Invalid Date` in the receivedMessage (#13543)
Fixes #12883 
## Bug
"Invalid date" for the `expiresAtUtc` property
```
azure:service-bus:messages:verbose AmqpMessage to ServiceBusReceivedMessage: {
  _amqpAnnotatedMessage: {
    header: { deliveryCount: 0 },
  .
  .
  .
  expiresAtUtc: Invalid Date,
  .
  .
  .
}
```

## Background
"ttl" on the received message will be undefined if the sent message doesn't have the "ttl" property set to a value. 
In this case, the service assumes the default infinite value for expiry time.
Reference: https://docs.microsoft.com/en-us/azure/service-bus-messaging/message-expiration#entity-level-expiration

### Cause (expiresAtUtc)
In the SDK, for a received message, we calculate the expiresAtUtc using the "ttl" and the enqueued time.
- If the msg.ttl > max_duration - msg.enqueuedTime, calculate msg.expiresAtUtc with max_duration
- If the msg.ttl < max_duration - msg.enqueuedTime, calculate msg.expiresAtUtc with msg.enqueuedTime  + msg.ttl
- If the msg.ttl is not defined on the received message, we return Invalid Date for the expiresAtUtc property.

## .NET SDK
TTL is defaulted to TimeSpan.MaxValue in .NET.
For ExpiresAt calculation:
- if AbsoluteExpiryTime is populated we use that.
- if TTL > maxDateTime - EnqueuedTime, use TimeSpan.MaxValue
- Else use EnqueuedTime + TTL


## Fix for JS SDK
If the msg.ttl is not defined, set it to the max value as the service says that. This allows the proper calculation of `expiresAtUtc`.

## TODO
- [x] Bug Fix
- [x] Test
- [x] Changelog
2021-04-14 23:33:44 +00:00
Richard Park 4dac947d84
[service-bus] Retries implemented for settling messages on the receiver link. (#14867)
This was the source of a few live test pipeline failures - it was not resilient against network failures.

RequestResponseLink retries will come in a separate PR as that's a bit more involved.

(also, renamed receiver/shared.ts to receiver/receivercommon.ts, just to reduce file naming confusion amongst multiple shared.ts files)

Partly related to #13796
2021-04-14 15:24:28 -07:00
KarishmaGhiya b45fa72681
update clean commands (#14693) 2021-04-07 18:31:38 +00:00
KarishmaGhiya 4f6c5f7d03
Doc settings Update (#14733) 2021-04-07 11:16:34 -07:00
Richard Park b8672bb5d5
[service-bus] Add support for sending AmqpAnnotatedMessage (and control destination section of body) (#14703)
Adding in support to send AmqpAnnotatedMessage and also to control where the body is encoded in the sent message (via the `bodyType`) field.
2021-04-07 06:50:49 +00:00
Richard Park 2fe92a1cb5
[service-bus] AdminClient: ForwardTo wasn't applying on update due to bad property ordering in XML (#14692)
The ordering of properties in the XML requests to the Service Bus ATOM API is significant and changing it can have side effects.

In this instance, the ordering issues caused us to appear to have setup forwarding properly for a queue but forwarding was NOT actually enabled. Our previous testing missed this because this data actually round-trips properly through the API but it doesn't trigger whatever actual setting needs to happen to cause forwarding to happen.

This PR reconciles our queue, topic and subscription entities ordering against the .net layer, which acts as the de-facto authority.

Fixes #14539
2021-04-05 19:45:27 +00:00
chradek decd401a5b
[service-bus] add support for NamedKeyCredential and SASCredential (#14658) 2021-04-01 08:48:46 -07:00
Azure SDK Bot 5150d7b857
Increment version for servicebus releases (#14642)
Increment package version after release of azure-service-bus
2021-04-01 00:18:03 +00:00
Harsha Nalluru 2c891708f9
[Service Bus] This internal type setTimeoutArgs is showing up in the (Typedoc) docs - removing (#14641)
setTimeoutArgs is only used internally.
2021-03-31 19:41:07 +00:00
Ramya Rao 593960a273
[Service Bus] Changelog for 7.0.4 (#14625)
Updated Changelog for 7.0.4, prepping for release
2021-03-31 00:53:50 +00:00
Richard Park ef6521029f
Tracing context was not getting propagated to the web request so parent tracing information was lost. (#14615) 2021-03-30 21:26:17 +00:00
Harsha Nalluru 2e61819004
[Service Bus] Update perf tests to use a single sender for all instances (#14460)
- Imports v7 in the v1 tests to allow creating the resources
- Makes sender static in both v1 and v7
2021-03-30 00:16:22 +00:00
chradek cd0edbc366
upgrade core-auth dep to ^1.3.0 (#14586)
`@azure/core-auth` added the `NamedKeyCredential` and `AzureNamedKeyCredential` symbols in version 1.3.0. Currently only `@azure/core-amqp` and `@azure/event-hubs` references these directly and need to be using 1.3.0, but updating in all packages that depend on it to satisfy rush.
2021-03-29 23:17:43 +00:00
Richard Park f1054c3076
[tracing] updating to opentelemetry 1.0.0-rc.0 (#14208)
* Upgrading to opentelemetry 1.0.0 (rc.0)

Did a few things that made this MUCH easier.

Now that everyone is using the createSpan from @azure/core-tracing we
no longer need _every_ project to reference opentelemetry/api! That has
been removed as part of this PR.

Unfortunately, the leaky nature of JS means that packages still need to
worry about opentelemetry when they build their browser bundle for
testing. To make that simpler I've added a common function to dev-tool
that everyone can call in their rollup that will give them the correct
named exports. This is hooked up for everyone at this point, so the next
time something like this happens I should be able to control it
centrally.

Now for the API breaking changes that I had to fix:
- CanonicalCode is gone and is replaced with SpanStatusCode.
  SpanStatusCode has a much smaller set of codes (literally: ERROR, OK
  or UNSET) so that simplified most of the way we were handling setting
  a span status on error.
- There is a new field (`tracingContext`) that contains `Context`. You
  now pass a context, not a span, to indicate what your "parent" is.
  You'll see this where I've removed `SpanOptions.parentSpan`. Mostly
  it's a simple replacement.
2021-03-29 15:18:40 -07:00
Ramya Rao d80a4714b8
[Service Bus] [Event Hubs] Use standard error msg for AbortError from core-amqp (#14494)
This PR has the below changes to ensure we use the standard error message for AbortError in Service Bus and Event Hubs
- Use the latest rhea-promise that uses the standard error message
- Update core-amqp to use the standard error message and export the same'
- Update EH and SB to use the standard error message from core-amqp

Fixes #13838
2021-03-26 18:11:36 +00:00
Ramya Rao 17bdd41380
[Service Bus] Add v1 changelog entries (#14514) 2021-03-25 14:59:10 -07:00
Richard Park 5f16b8459c
[service-bus] adding back in the null type (#14489)
When I restored the legacy option I didn't restore the option for the caller to pass in `null` as well.
2021-03-24 18:36:18 -07:00
Harsha Nalluru 70d860e33b
[Service Bus] Session Receiver (Both batching and streaming) during a disconnect (#13956)
### Issue https://github.com/Azure/azure-sdk-for-js/issues/8875

### What's in the PR
"disconnect"/refresh logic added before did not cover the session scenarios. 
This PR attempts to tackle the batching receiver for sessions upon "disconnect" scenarios to have a smooth-resolution/throw-errors based on the receiveMode.
Streaming receiver calls processError with SessionLockLost and closes the link

### receiveMessages - Scenarios to handle/test
- [x] throws "session lock has expired" after a disconnect
- [x] returns messages if drain is in progress (receiveAndDelete)
- [x] throws an error if drain is in progress (peekLock)
- [x] returns messages if receive in progress (receiveAndDelete)
- [x] throws an error if receive is in progress (peekLock)

### Streaming receiver
- [x] Test - calls processError and closes the link
 
### TODO
- [x] Cover the scenarios above
- [x] Tests
- [x] Bug fix - number of receivers - https://github.com/Azure/azure-sdk-for-js/issues/13990
- [x] Changelog
- [x] Streaming receiver - ~~beyond the scope of this PR~~ https://github.com/Azure/azure-sdk-for-js/issues/14212
- [ ] Bad log messages https://github.com/Azure/azure-sdk-for-js/issues/13989 - beyond the scope of this PR
- [ ] Stress testing plan for disconnect - https://github.com/Azure/azure-sdk-for-js/issues/13988 - beyond the scope of this PR

Fixes #8875
2021-03-23 21:50:19 +00:00
Harsha Nalluru 3ab1242915
[Service Bus] Clean command - Consolidate to "dist*" (#14442)
Addresses https://github.com/Azure/azure-sdk-for-js/pull/14438#discussion_r599881099
2021-03-23 21:05:02 +00:00
Harsha Nalluru a82856a8d6
Update browser test files in karma conf (#14438) 2021-03-23 12:44:24 -07:00
Will Temple a22db68cc5
[dev-tool] `samples publish` command and changes to samples workflow (#13960)
* [dev-tool] Experimental samples publish command

* Updated template samples structure

* First generation of template samples

* Update to ts-node 9 and use transpilation mode for speed.

* Many improvements and fixes.

- Fixed several bugs with generation.
- Added environment variable analysis.
- Refactored modules for code organization.
- Added azsdk- JSDoc tags for weighting and ignoring samples.
- Made almost all illogical situations yield errors instead of warnings.

* Rework text analytics

* Fixed a bug in the README template saying something about the Template package

* Regenerate text analytics samples

* Consistency changes to dev-tool/register

* Updated TA and Template package.json

* Fixed a couple of file name rendering bugs in the template

* Added API ref link override and regenerated Template samples

* Format

* Fix broken link

* Made typescript version reflect dev-tool ts dependency

* Revert weird change to cosmosdb package.json

* Alpha sort template deps

* Added MIN_SUPPORTED_NODE_VERSION

* Tweaked default tsconfig.

* Use version 1.0.0 instead of 0.1.0

* Pull sample generation info types into their own module.

* Added resource creation link generation.

* Regenerate template samples

* Regenerate text analytics samples

* Regenerate text analytics samples

* Regenerate template samples

* Fix bug in TA samples
2021-03-22 19:05:13 -07:00
KarishmaGhiya 7c5f7cf751
update test-browser output folder (#14384) 2021-03-22 23:39:34 +00:00
Deyaaeldeen Almahallawi a26462540e
Upgrade Typescript version to 4.2 (#14402)
Upgrade to the next minor version. See the release notes here: https://www.typescriptlang.org/docs/handbook/release-notes/overview.html#typescript-42.
2021-03-22 21:10:07 +00:00
Deyaaeldeen Almahallawi 5bf75f6185
Update TypeScript version to use ~ (#14387)
I confirmed with the TypeScript team that patch releases should not introduce breaking changes. This PR uses tilde in TypeScript version we use so get the latest patch releases for v4.1.
2021-03-22 02:26:08 +00:00
Richard Park 7ba6fee32b
[service-bus] Allow null as a type for applicationProperties (#14386)
Expanding the types for applicationProperties to allow `null` (and not `undefined`).

`null` and `undefined` both get mapped to 'null' if you round-trip through JavaScript. Sending through .net will properly map to null as well. 

Fixes #14329
2021-03-19 23:18:58 +00:00
Ramya Rao 3d8990aac4
Run format for SB, EH and Core AMQP (#14323) 2021-03-16 21:30:06 -07:00
Ramya Rao f1e774f3ab
[Service Bus] Linting error fixes (#13935) 2021-03-11 16:17:28 -08:00
chradek 2660692aff
upgrade karma from ^5.1.0 to ^6.2.0 (#14238)
* upgrade karma from ^5.1.0 to ^6.2.0

* rush update --full
2021-03-11 10:12:31 -08:00
Harsha Nalluru c203d01732
[Service Bus] Fix mocha glob pattern to pick tests correctly (#14127)
Fixes https://github.com/Azure/azure-sdk-for-js/issues/13797

Reference
- https://mochajs.org/#the-test-directory
- https://stackoverflow.com/questions/35482278/mochas-glob-behaviour/36050601
2021-03-05 20:57:35 +00:00
Richard Park b892efe1d5
[eventhubs,service-bus]: re-add legacy tracing options (#14113)
Adding in some compat code to handle converting from the older span structure to the newer OperationOption's based structure.
2021-03-05 12:56:11 -08:00
Richard Park cf99c3efa9
[core-tracing] In-place change of the version for core-tracing from -beta to -preview and compatible type change (#14082)
- Making some changes to simplify the "duplicate" models that we're exporting to mirror the opentelemetry models (addresses feedback from @xirzec and @bterlson)
- Switch core-tracing back to the `-preview` version naming style. Changing it mid-stream like we did breaks internal tooling.
2021-03-03 22:31:15 +00:00
KarishmaGhiya d1d33a4367
Fixing inconsistencies in package.json scripts (#13936) 2021-03-03 02:31:37 +00:00
Jeremy Meng c81faf961d
[service-bus][test] extract key values into constants (#14037)
* [service-bus][test] extract key values into constants

CredScan is computing hashes to identify locations of possible sensitive data.
Changes unrelated to the key values can cause the hashes to change. This PR
extract key values into constants in a separate file so the scan results remain
stable.

* Keep just one testConstents.ts under test/public/
2021-03-02 09:18:53 -08:00
Ben Broderick Phillips 1d3632650c
Update live test yaml to use cloud and matrix configuration (#13886)
* Update live test templates to use matrix generation

* Update sdk live tests to use matrix generation, cloud config stages

* Fix live test matrix filter parity errors

* Remove matrix filters. Opt-in most tests to samples and min/max testing

* Fix post step template parameter in monitor live tests

* Filter dependency version for live tests that don't support it

* Only publish test results for browser and node tests
2021-03-01 19:25:57 -05:00
Richard Park d28b4ae11a
Fixing it so we check to see if a created span is actually being recorded before we add it to the links for the overall span. If not, then we don't bother since it'll be the empty/null span and won't actually record anything of interest. (#14040)
When we were instrumenting spans we wouldn't pay attention to whether we were currently recording or not, which could lead to us creating a bunch of empty/null spans and trying to add them as links to the span for our batches.

Rather than do that I just check (when we instrument) if the span we created is recording and if not don't add it.

Fixes #13049
2021-03-01 15:43:43 -08:00
Jeremy Meng 3738fa358d
[template] Make README Logging section consistent (#14022)
* [template] Make README Logging section consistent

We might have introduced the inconsistency for some libraries while copying
content from other languages.

* Update other README files

Contents for messaging libraries (Event Hub/Service Bus) remain unchanges
because they are different in having additional information about `rhea`
logging.

* linking to logger
2021-03-01 09:42:22 -08:00
Richard Park 07404930f4
[event-hubs/service-bus] Change to use core-tracing's createSpanFunction (#13951)
Removing custom createSpan code in favor of core-tracing's createSpan functions. As part of this I also changed messageBatch.tryAdd() options related to tracing so it matched what OperationOptions. 

Also, fix in core-tracing so you can pass in a custom SpanKind (we were previously overwriting it).
2021-02-27 00:10:33 +00:00
Richard Park 82c42a2512
[telemetry] Centralize (as much as is practical) the creation of spans to ease upgrades (#13887)
As part of prepping for the next release of OpenTelemetry we found some code patterns that were going to become a large maintenance burden for us, primarily around the parenting of spans. To make this easier I've removed as many duplicate implementation of createSpan and tried to centralize everything into core-tracing instead. 

This won't completely remove changes needed for a newer version of OpenTelemetry but it'll eliminate one of the bigger bottlenecks.
2021-02-25 21:36:47 -08:00
Harsha Nalluru d0d1fca0f9
[Service Bus] Bad merge - Removing an unintentional duplicated test (#14000)
Bad merge at https://github.com/Azure/azure-sdk-for-js/pull/14000
2021-02-26 05:31:18 +00:00
Harsha Nalluru 281587dc69
[Service Bus] (minor) Bug Fix: `getNumberOfReceivers` helper method (#13993)
Fixes https://github.com/Azure/azure-sdk-for-js/issues/13990
"Number of receivers" returned is not a number. It was not a fatal bug since we only relied on its existence.
2021-02-26 02:06:40 +00:00
Sima Zhu 349613a6bd
Added main branch in ci yaml files (#13926) 2021-02-25 09:17:54 -08:00
Harsha Nalluru 8da80c733d
[Service Bus] Simplifying "disconnect" during drain test - for non-sessions (#13930)
Was looking at this test to compare the scenario during sessions as part of #8875.
Talked to @richardpark-msft and we agreed to simplify it as shown in the PR with slightly more meaningful comments.
2021-02-23 21:43:24 +00:00
Harsha Nalluru 2930b04b9f
[Service Bus] "disconnect" tests - for sessions (<== part-1) (#13929)
The test in this PR makes sure the receiving fails with the session lock lost error upon a disconnect.
More scenarios will be covered in future PRs, they'd involve changing src code and adding new tests.

"Hide Whitespace Changes" for review.
![image](https://user-images.githubusercontent.com/10452642/108798200-15dc9100-7542-11eb-8676-8ff1f4720c88.png)
2021-02-23 20:36:04 +00:00
Ramya Rao f3e0f2c48a
[Service Bus] Fix linting problems in test files (#13892)
This PR fixes about 150 linter errors and warnings in the test files of the Service Bus package.
Use `Hide whitespace changes" option to look at the real impacting changes
Related to #10781
2021-02-23 02:39:18 +00:00
Ramya Rao 55937f84f5
[Event Hubs] Promise executor functions should not be async (#13826) 2021-02-22 21:10:15 +00:00
Ramya Rao 65b209a32c
[Service Bus] Promise executor functions should not be async (#13818) 2021-02-16 18:26:42 -08:00
Ramya Rao ebf23ca905
[Service Bus] Fix remaining TSDoc errors (#13763)
This PR fixes the remaining errors around TSDoc 

Resolves #12955
Related to #10781
2021-02-12 23:49:05 +00:00
Ramya Rao 892f80c507
[Service Bus] Fix return tag to follow TSDoc (#13755)
This PR fixes over 90 linter errors around the `@returns` tag in Service Bus. Related to #10781

- Remove the type info in the `@returns` tag as this is redundant. TS tooling can figure out the typing info without needing us to have it add it here
- Remove the entire tag if it was not adding any information other than the type
2021-02-12 17:21:02 +00:00
Ramya Rao 8b55c9f721
[Service Bus] Fix no shadow, redundant await linter errors (#13757) 2021-02-12 09:12:25 -08:00
Ramya Rao a049450831
[Service Bus] Add missing return types (#13745) 2021-02-11 10:37:48 -08:00
Matt Ellis 57c3030ecf
[EventGrid] Prepare for v3.0.0-beta.3 Release (#13714)
* [EventGrid] Update core-auth reference

In b6040c5451 we took a dependency on
some new surface area in @azure/core-auth. That has now been released as
version 1.2.0, so we bump our minimum dependency to that version.

The other packages have been updated as well, to keep versions consistent.

* [EventGrid] Prepare for 3.0.0-beta.3 release
2021-02-09 18:05:12 -08:00
Harsha Nalluru 77f20bef0b
[Core AMQP] Update to rhea promise 1.1.0 (#13683)
This PR updates rhea promise version used in our AMQP libraries to 1.1.0, the recent rhea-promise release.
2021-02-09 20:08:44 +00:00
Harsha Nalluru db42a38bfc
[Service Bus] Fix `integration-test` command (#13673)
After @KarishmaGhiya's min-max PR and the reorganization, 

We don't have any tests at the top level, hence deleting the `test/*.spec.ts` from the mocha test file inclusion.
2021-02-08 23:07:48 +00:00
Richard Park 723d393a27
[service-bus] Add in long-running stress/perf test (#13547)
Added in the "long running test" that I had previously written, now ported to @HarshaNalluru's much nicer stress framework. This test is intended to run for long periods of time, sending messages every second (and receiving the entire time). This should complement some of the other tests we have that test more stressful/high perf conditions by allowing us to see how our code handles running long-term.

Also, some other changes for quality of life and others:
* Make tsconfig.json more strict to catch more errors and other "risky" constructs in the stress tests.
* Fix aforementioned risky and erroneous constructs (mostly just using before initialization, assuming falsy, etc..)
* Refactored stressTestBase (not too drastically) to allow for tracking statistics generated from outside of the stressBase. This lets you take advantage of the snapshotting and reporting but still be able to write all your own logic. More refactoring possible, but left as an exercise to a future reader (probably me later).
2021-02-05 20:32:59 +00:00
KarishmaGhiya c7a4bb1ff2
[service bus] Separate service bus tests to enable min-max tests (#12869) 2021-02-05 12:05:49 -08:00
Harsha Nalluru 2d4f84356d
Revert "[Service Bus] Revert core-amqp to 2.0.0 (#13401)" (#13574)
This reverts commit ba6bbbab05.

Since the service-bus 7.0.3 is released, we can move to the latest core-amqp.
2021-02-04 00:17:21 +00:00
Harsha Nalluru a569beebf1
[Service Bus] Fix test command to pick non-perf/stress files only (** -> *) (#13549) 2021-02-03 16:02:37 -08:00
Will Temple 9e4a451cb2
[dev-tool][smoke-tests] Use same configuration for skippable samples in live environments (#13515)
* [dev-tool] Use //sampleConfiguration for skips

* Replace all instances of smokeTestConfiguration with sampleConfiguration

* Formatting

* Tested file matching logic

* removed a left-over import
2021-02-03 17:55:30 -05:00
Richard Park e4dba8988b
[service-bus] Hit low-hanging fruit with linting errors (#13521)
There were some mechanical transform fixes we could for linting (beyond errors that could be autofixed). There are still _quite_ a few more remaining but this is the easy set that's more or less just rote transformations.

There are no code changes to speak of - this entire change occurs in the comments.

Part of a series of changes for #10781
2021-02-02 16:06:47 -08:00
Harsha Nalluru e15c04216d
[Service Bus] Perf tests with the framework (#12993)
### New perf folder
- The new "perf" folder uses the perf framework. 
- With the perf framework, only the send test can be written. 
- This PR adds the send test for track 1 and track 2.
- This would be useful in comparing track 1 and track 2, as well as for the cross-language comparisons.
- The track-2 tests depend on the current code on master and would require updates if the source code changes.

#### To execute the track 2 tests

1. Build the service-bus package `rush build -t service-bus`.
2. Navigate to `service-bus` folder `cd sdk\servicebus\service-bus\`.
3. Create a service-bus namespace and populate the .env file at `servicebus\service-bus` folder with `SERVICEBUS_CONNECTION_STRING` variables.
4. Run the tests as follows
   - batch send
     - `npm run perf-test:node -- BatchSendTest --warmup 2 --duration 7 --parallel 2`
#### To execture the track 1 tests

1. Navigate to `test-utils\perfstress` folder `cd sdk\test-utils\perfstress\`
2. Build the package `rush update && rush build -t test-utils-perfstress`
3. Pack the perf package `rushx pack`
4. Navigate to `service-bus\perf\track-1` folder `cd sdk\servicebus\service-bus\perf\track-1`.
5. Install the perf package `npm i ..\..\..\..\..\test-utils\perfstress\azure-test-utils-perfstress-1.0.0.tgz`
6. Run `npm install` to get `service-bus V1`.
7. Create a service-bus namespace and a queue with default options. Populate the .env file at `servicebus\service-bus` folder with `SERVICEBUS_CONNECTION_STRING` and `QUEUE_NAME` variables.
8. Run the tests as follows
   - batch send
     - `npm run perf-test:node -- BatchSendTest --warmup 2 --duration 7 --parallel 2`

### Existing perf tests
- There is an existing "perf" folder with the tests for send and receive for `azure-sb`, `rhea-promise`, `service-bus-v1`, and `service-bus-v7` libraries.
- These tests show the memory consumption too in the report. They do not use the perf framework. (And the perf framework isn't yet capable of handling the receive scenarios.)
- Retaining the existing tests for the above reasons.
- This PR renames the "perf" folder(with existing tests) to "perf-js-libs".
2021-01-29 22:23:11 +00:00
Richard Park 36fdf0d161
[service-bus] Make stress/perf easier to run with separate scripts and improve telemetry (#13475)
* Fixing a few problems and making telemetry better:
* The summary events now show all the individual counts as queryable fields in customDimensions
* Fixed a bug in runContainer.js and also made it easier to launch a container for any arbitrary script
* Added in an additional testName field to make it simpler to group telemetry by run
2021-01-29 13:05:00 -08:00
chradek 3c5cc6906d
[event-hubs][service-bus] re-export RetryMode (#13484)
* [event-hubs] re-export RetryMode

* [service-bus] re-export RetryMode
2021-01-29 10:09:51 -08:00
Shrill Shrestha 5864021d3e
service bus internal method rename #13390 (#13419)
Renamed `close` to `terminate` to resolve issue #13390.
2021-01-28 22:29:23 +00:00
Richard Park a9245b7d6c
[service-bus] Rather than using a variable that doesn't exist let's just use the same "<connectionString>" convention we used for the adminclient (#13428)
Fix readme to just use '<connectionString>' rather than referencing a variable that doesn't exist.

Fixes #13393
2021-01-27 16:39:53 -08:00
Richard Park a1a2401c06
[service-bus] Make our stress tests easier to run in containers (#13417)
* Some changes to make our stress tests easier to run in containers:
* Make a Dockerfile to hold the files
* Make a script (runcontainer.js) which allows you to easily build, push and create an ACI to run the stress test
* Updated the tests against the GA version of Service Bus (they were still using preview.8, aka Service Bus "classic")
2021-01-27 15:17:22 -08:00
Deyaaeldeen Almahallawi f9d1c248b8
[Docs] Fix the double tagging issue (#13411)
* [Docs] Fix the double tagging issue

* fix triple tagging!
2021-01-26 21:06:05 -05:00
Azure SDK Bot cbbaa4110b
Increment version for servicebus releases (#13409)
Increment package version after release of azure-service-bus
2021-01-26 21:03:06 +00:00
Harsha Nalluru 487b5444cf
[Service Bus] Stress tests - Migrate to 7.0.0 (#13404)
Just updating the version and fixing  related compile errors
2021-01-26 20:52:02 +00:00
Harsha Nalluru ba6bbbab05
[Service Bus] Revert core-amqp to 2.0.0 (#13401)
Since core-amqp 2.1.0 is not released, reverting to 2.0.0 so that service-bus 7.0.3 can be released.
This PR will be reverted after the 7.0.3 release.
2021-01-26 19:35:30 +00:00
Harsha Nalluru 6c2e993dd3
[Service Bus] Release Prep - 7.0.3 (#13334) 2021-01-26 03:46:17 +00:00
Harsha Nalluru 97ed12c84a
[Service Bus] Bug Fix: Uncaught error thrown from setTimeout callback (#13264)
### Issue 
https://github.com/Azure/azure-sdk-for-js/issues/13048

### Cause
Error thrown from the `actionAfterTimeout` method which is used as a callback for setTimeout cannot be caught in the try-catch at any level leading the program to crash.

### Fix
Make a promise and reject with error instead of throwing in the setTimeout callback.

### Changes in the PR
- [x] The mentioned bug fix
- [x] `... request with message_id "undefined" timed out ...` is thrown. Adds a uuid if none present
- [x] Test
- [x] Changelog
2021-01-26 02:45:17 +00:00
Harsha Nalluru 6cda731d51
[Service Bus] Bug fix: batching receiver upon a disconnect (#13374)
## Bug
- `receiveMessages` method returned zero messages upon a connection refresh caused by a network disconnect(simulated in the test). 
- `OperationTimeout` error on message settlement after the disconnect

These two failures made the "disconnect" test occasionally fail for the batching receiver.

## Cause
`onDetached` on the batchReceivers is called 300ms after the connection refresh causing the recovered receive link to be closed.

- If the message returned from the service took close to 300ms until reached the receiver since the refresh, `onDetached` is called to close the link leading to the loss of messages.
- If the 300ms had elapsed right before the settlement, we'd see the OperationTimeout error on settlement since the receive link is closed.

Investigated here https://github.com/Azure/azure-sdk-for-js/pull/13339

## Fix
- Call `onDetached` for the batching receivers before calling the refresh connection
- And retain calling `onDetached` for the streaming receivers after the refresh connection

## Changes in the PR
- [x] Refactored "calling onDetached" part
- [x] Removed the 300ms delay since we don't see the utility
- [x] Changelog
- [x] TODO: What to do for sessions?
   - [x] Needs more investigation https://github.com/Azure/azure-sdk-for-js/pull/13374#discussion_r564139864, will be handled at #8875
2021-01-26 01:54:37 +00:00
Harsha Nalluru 332f56ac6c
remove hidden tag for an interface to test docs.microsoft.com (#13332) 2021-01-25 15:36:35 -08:00
Harsha Nalluru 1afabd3c87
[Service Bus] Fix flaky test - Peek until we get the message (#13346)
Investigated at https://github.com/Azure/azure-sdk-for-js/pull/13336 to figure out and fix the flakyness.

Sometimes, the service returns zero messages for the peek call and is forcing us to retry the peek operation until we get the message so the test is green.

(We may have other tests that may fail with the same, we can extend this fix to those tests as needed.)
2021-01-25 22:32:10 +00:00
Harsha Nalluru 832c98f52a
[Service Bus] Fix DEBUG variable (#13348) 2021-01-22 20:52:18 +00:00
Jeff Fisher 40b027df46
Update karma test configuration for track2 packages (#13309)
This PR removes our dependency on the unmaintained package "karma-remap-istanbul" and replaces it with a smaller karma plugin ("karma-sourcemap-loader") that allows karma-coverage to load source maps from the disk correctly.

I tested and confirmed that the generated coverage data has the correct source TS files.
2021-01-22 19:42:51 +00:00
Harsha Nalluru 5a4222e772
[Service Bus] Flaky test - Add delay to make sure the expiry time upon renewlock gets updated (#13330)
Hundreds of iterations of this test succeeded here https://github.com/Azure/azure-sdk-for-js/pull/13325
2021-01-21 22:13:18 +00:00
Harsha Nalluru f921baef73
[Service Bus] Flaky Test - Report a meaningful error (#13311) 2021-01-20 17:19:15 -08:00
Harsha Nalluru 28a534f8cd
[Service Bus] Minor updates to stress tests (#12561)
This PR adds 
- a new option `sendAllMessagesBeforeReceiveStarts` which would be useful if we want to receive a ton of messages in the queue.
- tracking more info related to the messages
- other minor fixes
2021-01-21 00:04:39 +00:00
Harsha Nalluru 2633610112
[Service Bus] Bug Fix: getSubscriptionRuntimeProperties returns activeMessageCount as zero (#13229)
### User issue
User complained that the active message count that was returned in the subscription runtime properties is zero when there are three messages. #13219
Reason for the failure is that the manually written parser in the service-bus JS SDK looks for the "d2p1" xmlns-prefix while the response had "d3p1" as the xmlns-prefix.
### More Background
`MessageCountDetails` from the list runtime method has "d2p1" prefix whereas the runtime props method for a single subscription has "d3p1" prefix.
Swagger mentions only the "d2p1" prefix: 1f4095f20a/specification/servicebus/data-plane/servicebus-swagger.json (L367)
### Fix
As a fix for JS, since we have a manual parser and not depending on codegen, this PR attempts to get the xmlns prefix from the response to be able to obtain the details.
### Followup
.NET, Java, and Python SDKs do not fail in the same way as they don't depend on the prefix that is mentioned in the swagger to parse the details.
2021-01-20 03:21:01 +00:00
chradek 7f9696888d
[event-hubs] re-add support for custom endpoint address (#13287)
We had reverted the custom endpoint address changes in #13096 so that we could do a core-amqp release.

This PR reverts that revert and removes the 'beta' moniker from the event hubs version number.

Original PR: #12909
2021-01-20 01:09:11 +00:00
Deyaaeldeen Almahallawi 78e55c88a8
[Docs] Upgrade typedoc to v0.15.2 to match that used by docs team (#13250)
* [Docs] Upgrade typedoc to v0.15.2 to match that used by docs team

* standardize the docs script for cosmos, kv-admin, comm-common, and storage-internal-avro
2021-01-15 16:24:16 -05:00
Azure SDK Bot 6b308a640e
Increment package version after release of azure-service-bus (#13206) 2021-01-13 16:51:50 -08:00
Harsha Nalluru d0789f5b9f
[Service Bus] Release prep - 7.0.2 (#13203) 2021-01-13 21:02:35 +00:00
Harsha Nalluru 1e1b71b4fb
[Service Bus] Bug Fix: Sessions - Receive messages beyond 2048 in "receiveAndDelete" mode (#13178)
### Problem
Send 10K messages... 10K messages are received just fine for non-sessionful queues. For sessionful queues, receiving stops after receiving 2048 messages with `subscribe` method and leaves the receiver hanging. (Same with `receiveMessages` API if requested for a large number of messages or called in a loop)

### Reason
The difference between messages from sessionful and non-sessionful queues is the "settled" flag - it is "true" for non-sessions but "false" for sessions which makes the circular buffer full. ("rhea" checks the "settled" flag to pop the deliveries from the circular buffer)

The "settled" flag is updated in rhea mainly by a couple of methods, auto_settle and auto_accept. And this "auto_accept" method can be invoked by setting the "autoaccept" option to true in the receiver options while creating the receiver in the receiveAndDelete mode, which is being set for the non-sessions case, but not for the sessions at the SB SDK level.

### Fix
Set the "autoaccept" option to true in the receiver options for the receiveAndDelete mode for sessions to be able to clear the buffer in "rhea".

### Related issues
https://github.com/Azure/azure-sdk-for-js/issues/13109 https://github.com/Azure/azure-sdk-for-js/issues/11633 https://github.com/Azure/azure-sdk-for-js/issues/8875

### TODO
- [x] There is common code in `messageReceiver.ts` and `messageSession.ts` that can be refactored.
- [x] Test that this PR fixes the receiveBatch scenarios too
- [x] Changelog
2021-01-13 18:17:59 +00:00
Azure SDK Bot 697eeb9aa7
Increment package version after release of azure-service-bus (#13154) 2021-01-11 16:04:49 -08:00
Harsha Nalluru 0ed49c29c5
[Service Bus] 7.0.1 release prep (#13144) 2021-01-11 19:24:16 +00:00
Harsha Nalluru b76efbb4c1
[Service Bus] Remove message count check - flaky rule filter test (#13131)
https://github.com/Azure/azure-sdk-for-js/pull/13105 investigates the flakyness.

The reason why the message count in the test can sometimes(5/1000 times) be zero is that the sent messages might not have been filtered into the subscription by the time we call the runtime properties method.

If we call the receiveMessages directly, the inherent delay would help in receiving the messages and should be enough for the test.
2021-01-08 23:11:56 +00:00
Maor Leger a41e85399c
Fix package.json linting errors (#13070)
## What

Audit Track 2 libraries and address any linting errors in package.json
Fixed anything that seemed safe, and anything that seemed like a 
potential breaking change was confirmed with the owners or reduced
to a warning.

## Why

Another step towards being able to run the linter in our builds.

fixes #10597
2021-01-07 09:37:27 -08:00
chradek fd8a260c30
[core-amqp] Revert 2.1.0 changes and prep for 2.0.1 release (#13096)
* Revert "[core-amqp][event-hubs] support specifying a custom endpoint (#12909)"

This reverts commit 336c6cfba1.

* [core-amqp] prep for 2.0.1 release
2021-01-07 08:42:14 -08:00
Harsha Nalluru 2e355ebc06
[Service Bus] Bug Fix: Correlation Rule Filter with the "label" doesn't filter the messages (#13069)
### BUG
https://github.com/Azure/azure-sdk-for-js/issues/13063
The correlation filter with the "subject" set using the `createRule` method doesn't filter the messages to the subscription. However, when we create the rule with the same correlation filter from the service bus explorer, messages get filtered as expected.

### CAUSE
The key-value pairs having undefined/null as the values can be present in the request object at any level. They get serialized as empty tags in the XML request for the ATOM management operations.

If such empty tags are present at the top level, the service throws a "Bad Request" error. This was handled by the SDK to make sure that the top-level of the request body doesn't have any empty tags.

If such empty tags are present at the inner levels, the service assigns the empty strings as values to the empty tags instead of throwing an error. This wasn't handled and the empty tags at the rule filter created an unexpected filter for the subscription. This PR attempts to fix this issue.

### FIX
The key-value pairs having undefined/null as the values are removed recursively from the object that is being serialized.
2021-01-07 01:15:03 +00:00
Richard Park a72e5e2d5a
[service-bus] Making BatchingReceiver properly cleanup after an abort (#13073)
Some more fixes related to the prior PRs around making BatchingReceiver behavior consistent:

* When we are closed (without error) or if we're in receiveAndDelete mode, we use the setTimeout() to ensure that we run after all pending message callbacks have fired
* We always cleanup our handlers before resolve/reject and it's made more clear if we're resolving immediately or resolving after pending message callbacks.

I also did some small refactors to make unit testing a bit easier, which should help make it simpler to validate this code path in the future.

Fixes #12922
2021-01-06 16:25:55 -08:00
Adam Ling (MSFT) 0b18dd62f8
Update migrationguide.md (#13067) 2021-01-05 18:59:30 +00:00
Deyaaeldeen Almahallawi 494327fa57
replace @ignore with @hidden (#12963)
`@ignore` is a JSDoc construct which we no longer use. This PR replaces it with `TypeDoc`'s `@hidden` which [exhibits the same behavior](https://github.com/TypeStrong/typedoc/releases/tag/v0.12.0).
2021-01-05 04:17:33 +00:00
Ramya Rao 3eba27e187
Add note on admin client features in SB service level readme (#13018) 2020-12-23 23:51:26 +00:00
Deyaaeldeen Almahallawi 8ab8d4cbf7
[Docs] Add --excludeExternals to rushx docs command (#12987) 2020-12-23 14:18:07 -08:00
Harsha Nalluru 91b0caaba2
[Service Bus] Perf tests for track 2 and update track 1 ones to latest (#11854)
* perf tests for track 2 and update track 1 ones to latest

* Add memory consumption too

* batch API call update

* Update _messages increment in send track 1 test

* \t in logged output

* Add peeklock variation for streaming test

* Batch api perf test

* fix converting to bool

* Move to GA v7

* "private": true,

* Import v7

* fix instructions

* omit paths

* Update sdk/servicebus/service-bus/test/perf/service-bus-v1/receiveBatch.ts

Co-authored-by: chradek <51000525+chradek@users.noreply.github.com>

* Update sdk/servicebus/service-bus/test/perf/service-bus-v7/receive.ts

Co-authored-by: chradek <51000525+chradek@users.noreply.github.com>

* Update sdk/servicebus/service-bus/test/perf/service-bus-v7/receiveBatch.ts

Co-authored-by: chradek <51000525+chradek@users.noreply.github.com>

Co-authored-by: chradek <51000525+chradek@users.noreply.github.com>
2020-12-23 10:54:13 -08:00
Harsha Nalluru a640bde2e2
[Service Bus] Delete v1 stress tests and move track 2 tests to "stress" folder (#13008)
This PR does nothing more than cleaning up.
2020-12-23 01:13:52 +00:00
Ramya Rao fbe7a52985
[Service Bus] Update migration guide to follow template (#12995)
This PR updates the Service Bus migration guide to follow the [template](https://github.com/Azure/azure-sdk/pull/2132) to fix #12366
2020-12-22 18:21:15 +00:00
Ramya Rao 122bc4bc89
[Service Bus] Update changelog for 7.0.1 (#12989)
This PR adds changelog entry for https://github.com/Azure/azure-sdk-for-js/issues/12983
2020-12-21 19:45:16 +00:00
Martin Ligtenberg b5424bb757
[@azure/service-bus] Fix invalid check for Node (#12985) 2020-12-21 11:24:27 -08:00
chradek 336c6cfba1
[core-amqp][event-hubs] support specifying a custom endpoint (#12909)
Fixes #12901 

### Purpose of change

Some users run their applications in a private network that lacks access to public endpoints, such as <namespace>.servicebus.windows.net. Due to these restrictions, these applications are unable to create direct connections to the Azure Event Hubs service using the standard endpoint address and require the ability to specify a custom host name to ensure they route through the proper intermediary for the connection to be made.

### Testing

I've added tests that verify the connection has been configured with the custom endpoint correctly.

I also manually ran these changes by setting up an Application Gateway in Azure with:
- backend pool with a backend target that points to the FQDN of my Event Hubs Namespace (`<namespace>.servicebus.windows.net`)
- A front-end listener using a HTTPS and a nonstandard port (200).
- HTTP settings with the following:
   - backend port: 443
   - Override with new host name: set to 'Yes'
- A rule that maps the front-end listener to the back-end target and uses the HTTP settings above.

I then had a test script that sent events, received events, and called operations on the $management link setting the `customEndpointAddress` to the public IP address from my application gateway.

Here's a simplified version of that script:
```js
const { EventHubProducerClient } = require('@azure/event-hubs');
const ws = require('ws');
const connectionString = `Endpoint=sb://<namespace>.servicebus.windows.net/;SharedAccessKeyName=sakn;SharedAccessKey=key`;
const eventHubName = `my-hub`;

async function run() {
  const client = new EventHubProducerClient(connectionString, eventHubName, {
    customEndpointAddress: `https://my.ip.address:200`,
    webSocketOptions: {
      webSocket: ws
    }
  });

  const props = await client.getEventHubProperties();
  console.log(props);
  return client.close();
}
run().catch(console.error);
```

Note that in my application gateway I also used self-signed certs so needed to do some additional work so node.js would recognize my certificate, but that's separate from the customEndpointAddress work and doesn't require changes from our SDK.
2020-12-18 01:55:41 +00:00
Deyaaeldeen Almahallawi be0e8353f5
Remove @param and @returns tags if they have no description (#12943)
Address feedback for https://github.com/Azure/azure-sdk-for-js/pull/12912.
2020-12-17 22:59:32 +00:00
Deyaaeldeen Almahallawi 7e0bd75263
[Docs] Adding docs npm script (#12941)
This newly added command `docs` can help increase the quality of our documentation comments. It enables us to have a tight feedback loop on what is being generated as a documentation of our packages. I am pinning `typedoc` to v0.15.0 for now because this is the version being used for generating docs at `docs.microsoft.com`. This version should be updated when that team updates theirs.

Fixes https://github.com/Azure/azure-sdk-for-js/issues/12928
2020-12-17 22:03:10 +00:00
Richard Park a60fab312a
When we go down the 'drain' code path for batching receivers we need to keep the event listeners in place until we actually resolve the promise. (#12908)
When we went down the 'drain' path with BatchingReceiver we'd actually remove the event listeners. 

With the old code this could happen:

1. message received, debounce timer set
2. debounce timer fires
3. drain is requested (also removed the event listeners!)
4. message arrives (ignored)
5. receiver_drain arrives and resolve's the promise but the message in step 4 is lost.

The simplest way to reproduce this was to just connect over a slower link (created an SB in AU, which is slower than connecting over to something in the US) and send some about 100 messages (I used 2k-ish of text for each one) - this made it more likely that you'd end up with only a partial transfer of messages and have a drain. This became even more obvious once we moved to scheduling the promise resolution with setTimeout() as it widened the gap (this bug was less easy to see before!).

Many thanks to @enoeden for finding this bug!

Fixes #12711
2020-12-16 11:34:23 -08:00
Deyaaeldeen Almahallawi 6b838b852d
Upgrade ESLint version to 7.15.0 (#12894)
All the heavy lifting for upgrading our linting packages has been already done here https://github.com/Azure/azure-sdk-for-js/pull/12770. This PR upgrades ESLint only and fixes https://github.com/Azure/azure-sdk-for-js/issues/9050.
2020-12-15 15:17:43 +00:00
Deyaaeldeen Almahallawi 79be172c74
Upgrade TypeScript compiler version to 4.1.2 (#12770)
* upgrade TS version and fix compilation issues

* upgrade the linting parser version and fix new linting issues

* fix cosmos sample

* address feedback

* fix linting issues in formrecognizer tests

* use unknown instead of any across our code

* address more issues

* cleanup package.json in core-http

* revert noisy linting changes caused by vanilla eslint rules not TS aware

* allow the poller to have results of type void

* fixing samples

* fix keyvault-certificates' sample
2020-12-14 17:03:55 -05:00
Richard Park 67085ee114
[service-bus] Addressing some incorrect samples and missing migrationguide.md section (#12879)
Fixes #12861
2020-12-14 19:17:53 +00:00
Richard Park f80145376e
[MQ: build reliability] Export the SERVICE_BUS_ENDPOINT output value for usingAadAuth.js (#12818)
There were several issues causing the smoke tests to not be a useful signal - this PR improves on the situation and gets us back to green. There are still some issues that require followup which I'll be filing soon.

Fixes:
* ServiceBus was only whitelisting a single sample (usingAadAuth.js) which _used_ to pass but only because it wasn't doing any real work. When we changed it awhile back to actually attempt to use it's connection it failed. This still needs some investigation but in the meantime I've swapped it out and brought in some more useful samples like sendMessages.js, browseMessages.js and sessions.js, which should give us some coverage. This also required altering the test-resources.json so it properly created the sample queues as well as outputting them so they'd get set in the environment.
* FormRecognizer had some failing samples. After talking with @willmtemple I ignored one of them that will require some actual test data to be bootstrapped reasonably (so not necessarily a good candidate for this). I fixed another one that appeared to just not handle some data being empty (seems legitimate, but perhaps it's a bug).d up in the sample's environment.

Fixes #12803
2020-12-11 10:50:27 -08:00
Richard Park d057d25feb
[service-bus] The time for v2 has come. Stop advertising the v1 samples! (#12799) 2020-12-07 23:48:19 +00:00
Richard Park 20bed382cf
[service-bus] Fix issue on drain where `onDrain` and `onMessage` might sequence incorrectly. (#12772)
Fixes an issue where drain could potentially resolve a promise even though some messages are pending processing.

This can happen if the user calls receiveMessages(5), for instance, and the timeout expires before they receive 
them all - when this happens we then 'drain' the excess credits by sending a request to Service Bus on the link. Now, let's say that before the drain _response_ comes in we receive some of the other messages (after all, we requested 5). Those messages are then, via setTimeout(emit, 0), scheduled to be sent to our onMessage handler. They are not dispatched to us immediately.

Now, when the drain response arrives (prior to this fix) the drain is processed immediately (unlike other messages the rhea-promise code does not call it with setTimeout), potentially bypassing any onMessage callbacks that are still waiting to be processed in the task queue.

By using setTimeout() here we use the same technique that the messages are scheduled by, ensuring that the resolve() is processed after any of those pending callbacks.

Fixes #12711 (potentially)
2020-12-07 12:14:58 -08:00
chradek 4f1598970a
[event-hubs][service-bus] updates (EventData|ServiceBusMessage).body documentation (#12714)
* [event-hubs] updates EventData.body documentation

* [event-hubs] update changelog

* improve docs!

* [event-hubs] update changelog entry

* [service-bus] updates ServiceBusMessage.body doc
2020-12-03 14:22:45 -08:00
Richard Park a928820bea
[service-bus] Readme updates for dead letter queues, point to proper docs (#12718)
* Add in section for dead letter queues
* Add docs links for the settlement methods
* Change our api ref to point to docs.microsoft.com now, rather than the blob generated ref docs.
2020-12-02 09:50:33 -08:00
Harsha Nalluru d35744ddae
[Service Bus] Minor sample update (#12670) 2020-11-23 22:02:59 +00:00
Harsha Nalluru 5a958f6fc5
[Service Bus] Samples and Readme updates for GA (#12668) 2020-11-23 20:44:03 +00:00
chradek f517fe42ea
[service-bus] remove Preview from service-bus (#12664) 2020-11-23 10:42:05 -08:00
chradek d3470b2827
[service-bus] prepare for 7.0.0 release (#12645)
Huzzah!
2020-11-20 19:17:39 +00:00
Harsha Nalluru c55396360d
[Service Bus] Update migration guide with perf improvements and coming up features (#12629) 2020-11-19 20:48:29 -08:00
Harsha Nalluru c10379225a
[Service Bus] Improve docs (#12615) 2020-11-19 20:47:51 -08:00
Ramya Rao 3ce1a57596
Service level readmes for Service Bus, Event Hubs and Key Vault (#12599) 2020-11-19 20:47:16 -08:00
Harsha Nalluru efa3c3a440
[Service Bus] _amqpAnnotatedMessage -> _rawAmqpMessage (#12635) 2020-11-19 20:41:09 -08:00
Harsha Nalluru c61327d30b
[Service Bus] Final round of API feedback before GA (#12608)
- Removing ` ClaimValue` since it is not settable by the user.
- Hiding `sender.open()`
2020-11-19 21:28:19 +00:00
chradek 279f6bfc95
[service-bus] remove unnecessary wrapper in streaming receiver (#12604)
Fixes #12260 
The code that's removed is no longer necessary since the `retry` method is being called in a loop and the loop only calls the user's processError handler after the retries in a single `retry` call are exhausted.
2020-11-18 18:45:02 +00:00
chradek 3254fe944a
[service-bus] Remove public usages of MessagingError and improve ServiceBusError GeneralError messages (#12585)
Fixes #12559 and #12573 

This change updates `ServiceBusError` in 2 ways.
1. Adds a constructor that accepts `message` and `code` directly. This lets us throw `ServiceBusError`s from the client without having to first create a `MessagingError`.
2. Update the constructor so that if a MessagingError's code is translated to `GeneralError`, the MessagingError's code is prefixed in the ServiceBusError message. This should provide additional context to the user on what went wrong.
2020-11-17 22:07:54 +00:00
Harsha Nalluru 21969bb3db
[Service Bus] ATOM API: Allow configuring the rule with createSubscription (#12495)
### Issue #12345 

Adding support to allow configuring the rule with createSubscription by taking the [XML request](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/servicebus/Azure.Messaging.ServiceBus/tests/SessionRecords/ServiceBusManagementClientLiveTests/BasicRuleCrudOperationsAsync.json#L66-L71) from .NET SDK as reference.
(Thanks @JoshLove-msft)
2020-11-17 02:24:40 +00:00
chradek 17a3aed4d7
[service-bus] Rename ServiceBusErrorCode Unauthorized to UnauthorizedAccess (#12571)
This change makes us more consistent with the AMQP condition and the .NET exception.
2020-11-17 02:15:33 +00:00
Ramya Rao 993c7bcb69
[Service Bus] autoComplete -> autoCompleteMessages (#12558) 2020-11-16 17:48:16 -08:00
chradek e8b73af38f
[service-bus] Documentation Review for version 7 (#12569) 2020-11-16 17:42:51 -08:00
Harsha Nalluru cab60f4b4c
[Service Bus] Link messageSpanContexts while sending - for array of messages (#12508)
For sending the array of messages case, we weren't linking the message span contexts while creating the send span.
This PR attempts to fix that!
2020-11-17 00:38:14 +00:00
Ramya Rao ea4ad0d17d
[Service Bus] Remove ReceiveMode from public API surface (#12557) 2020-11-16 11:07:08 -08:00
chradek a5ba0748cc
[core-amqp][service-bus] Prunes core-amqp public API and move ServiceBusError.reason to ServiceBusError.code (#12499)
This change updates the `ServiceBusError.code` field to match what was the `ServiceBusError.reason` field.

This allows us to remove the `MessagingErrorCodes` from the public interface, which we don't see as providing value above and beyond what the `ServiceBusCodes` provides.
2020-11-12 03:17:32 +00:00
Matt Ellis 3d7ae465ef
[service-bus] Small README.md update for sessions (#12506)
It looks like the README.md still had a reference to the
`createSessionReciver` function which was removed in a previous preview.
I removed the reference to this method as the next two paragraphs
describe the two ways to actually create the session.
2020-11-12 02:32:43 +00:00
chradek 62c1827c59
[service-bus] loosens parameter type in isServiceBusError type guard (#12493)
* [service-bus] loosens paramter type in isServiceBusError type guard

* change unknown to any
2020-11-11 17:55:25 -08:00
Ramya Rao ff9d8cda41
[Service Bus] Throw when partitionKey is not same as sessionId (#12490) 2020-11-11 15:40:46 -08:00
Harsha Nalluru 655c24705d
[Service Bus] ATOM API: Correlation Filter - `int` and `double` as values under properties (#12349)
### Issue https://github.com/Azure/azure-sdk-for-js/issues/9850 (part 9)

### Description
This PR is regarding the serialization/deserialization of int-double-number types in the applicationProps under correlation rule filter and the optimal way to support them in the SDK.
<img src="https://user-images.githubusercontent.com/10452642/98731900-3eee6280-2353-11eb-8da1-81c0e8cb731d.png" height=150>

#### Before this PR
All numbers are treated as "int"

#### With this PR
For serialization, numbers are treated as "double".
During deserialization, "int" and "double" are treated as numbers.(To allow interop)

Reference https://github.com/Azure/azure-sdk-for-js/issues/9850#issuecomment-713183518
2020-11-11 20:29:46 +00:00
Harsha Nalluru b6434780b8
[Service Bus] Stress Tests - followup PR (#12229)
### Original issue - https://github.com/Azure/azure-sdk-for-js/issues/11108
Follow-up of the stress tests PR https://github.com/Azure/azure-sdk-for-js/pull/11546, here are the changes
- Uses the latest preview.8 version of the service-bus SDK
- Fixes the boolean options being passed as command-line args
- Multiple sessions support in the renew session lock test
- Adds (some)new options that can be passed as command-line args to the tests
- And maybe minor edits
2020-11-11 20:08:44 +00:00
Ramya Rao 1cdf394cdf
[Service Bus] maxMessageCount validation updates (#12453) 2020-11-11 10:23:06 -08:00
Harsha Nalluru a79e081ede
[Service Bus] Fix log message at `actionAfterWaitTimeout` (#12322) 2020-11-10 15:04:34 -08:00
Ramya Rao 007104004f
[Service Bus] Update client side validation for settling msg, renewing locks (#12404) 2020-11-10 12:41:08 -08:00
Harsha Nalluru 8a96b00655
[Service Bus] Mention "CORS not supported" in readme (#12341)
### Issue https://github.com/Azure/azure-sdk-for-js/issues/4983
2020-11-10 20:12:13 +00:00
chradek 93444da132
[core-amqp][event-hubs][service-bus] move DataTransformer from core-amqp to client packages (#12415)
Part of the list of breaking changes to core-amqp v2 in #12116
Replaces #12320 (precipitated by https://github.com/Azure/azure-sdk-for-js/pull/12320#discussion_r518438209)

This change moves the `DataTransformer` interface and `DefaultDataTransformer` class to service-bus and event-hub packages.

When we establish what our data serde strategy is, we can revisit using a shared common serde solution.
2020-11-10 02:16:32 +00:00
Harsha Nalluru 1e8ad24167
[Core AMQP] Do not stringify entityPath for `undefined` (#12321)
Fixes https://github.com/Azure/azure-sdk-for-js/issues/8105 and https://github.com/Azure/azure-sdk-for-js/issues/11155
2020-11-09 19:43:04 +00:00
Ramya Rao c22ad7d318
[Service Bus] Remove Connection Context from ServiceBusMessage (#12398)
In #12216, we moved the code to settle a message and renew its lock from the ServiceBusMessageImpl to the ServiceBusReceiver. After this move, the only dependency left on the ConnectionContext in the ServiceBusMessageImpl is for the DataTransformer. This PR updates the ServiceBusMessage constructor to take the DataTransformer instead of the ConnectionContext and thus remove this dependency altogether. 

This closes #9944 as we no longer need to track the context or the receiver on the message.
This closes #10620 as well. Since the context is not being tracked on the message anymore, it does not matter that the data transformer is tracked on the context.
2020-11-09 18:05:10 +00:00
Ramya Rao 7e9fcae343
Update Service Bus migration guide with more pointers, and use similar general text in Event Hubs (#12350) 2020-11-06 21:51:50 -08:00
Harsha Nalluru 2425a880b9
[Service Bus] This test is doesn't test anything (#12314)
This test was unintentionally checked-in as part of a huge PR, I meant to remove it but left it since it was harmless.
Just cleaning it up now to reduce the false positives in [here](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=606570&view=logs&j=073ebbf1-9390-59a1-0ff8-08c656576bcd&t=428931fe-c351-55db-0604-c27a1c97620f).
2020-11-05 20:21:18 +00:00
Harsha Nalluru 82ff76f468
[Service Bus] Fix samples (#12289) 2020-11-04 22:01:36 -08:00
Harsha Nalluru b90c2a7128
[Service Bus] Revert core-http pin 1.1.9 and core-amqp pin 2.0.0-beta.1 👋 (#12292) 2020-11-04 21:59:55 -08:00
Harsha Nalluru 0c118a73a7
[Service Bus] Pick older core-http for service-bus preview.8 🏁 (#12285)
Pick older core-http(~~1.1.6~~ 1.1.9) for service-bus preview.8 since 1.2.0 is not released.

This will be reverted once the service-bus preview.8 is released.
2020-11-04 23:48:27 +00:00
Harsha Nalluru 48c5853f8c
[Service Bus] Fix readme and typedoc for preview.8 (#12282)
Let's release preview.8!
2020-11-04 21:15:59 +00:00
Ramya Rao 3551068571
Increment version for core-amqp v2 (#12267)
Next core-amqp release will be v2, updating files accordingly so that we can close #12266

Service Bus preview 8 is using core-amqp v2.0.0-beta.1 which has `MessageErrorCodes` and not `MessagingErrorCodes`. Updating SB to use `MessageErrorCodes` for now. Once SB preview 8 is released, we will update it to use v2.0.0 of core-amqp and revert this change
2020-11-04 01:54:35 +00:00
Ramya Rao 910e09be85
[Service Bus] Preview 8 prep in changelog (#12265)
Apart from adding the date for the preview, I have moved around the changelog items to move higher impact changes up
2020-11-04 00:48:25 +00:00
Richard Park ede8879f32
[service-bus] Use ServiceBusError when reporting errors to the user (#12237) 2020-11-03 16:14:41 -08:00
Richard Park a8e3145ae3
[service-bus] Removing the 'export' keyword that should have never been there. (#12234)
I owe @HarshaNalluru an apology - these 'export main' should never have been in the JS samples :|
2020-11-03 01:54:28 +00:00
Ramya Rao 1cec6efcef
[Service Bus] Update changelog (#12227)
This PR updates the changelog for the changes introduced in PRs the past couple of days
2020-11-02 20:36:46 +00:00
Ramya Rao 54247fdd1b
Core AMQP cleanup for v2 (#12210) 2020-11-02 11:48:34 -08:00
Ramya Rao 937f4b5012
[Service Bus] Move settlement method impl out of message (#12216) 2020-11-02 11:43:33 -08:00
Ramya Rao 039e1596bd
[Service Bus] subQueue -> subQueueType (#12223) 2020-11-02 11:35:39 -08:00
Ramya Rao eedd0cf847
[Service Bus] Empty array validation (#12207)
This PR ensures we do an early exit when input is empty array to methods that take an array as input
This closes #12095 which was logged for the `receiveDeferredMessages()` method and also fixes the same for `scheduleMessages()` and `cancelScheduledMessages()` calls
2020-11-02 18:18:56 +00:00
Ramya Rao bb6e4c0b20
[Core AMQP] Remove userId until its type is fixed in rhea (#12208)
As seen in https://github.com/amqp/rhea/issues/323, `user-id` is wrongly typed in rhea.

This PR removes userId from the AMQP message properties in `@azure/core-amqp` package for now.
We will add it back once the type for `user-id` is settled on and rhea releases an update
2020-11-02 18:17:31 +00:00
Mohsin Mehmood 1e6c5355f6
[Service bus] Improve debug logs ATOM API (#12187) 2020-11-02 00:06:58 -08:00
Ramya Rao 9de8a5be4b
[Service Bus] Use batch in samples (#12199)
This PR updates our samples as follows:
- Update comments in certain TS samples to match what is in the JS ones
- Update the sendMessages sample to use the batch
- Update the sendMessages sample in readme to use the batch

Closes #12118
2020-10-30 23:01:06 +00:00
Harsha Nalluru ab6d496f66
[Core AMQP] AmqpMessage -> RheaMessage 🔗 (#12169)
`Message` from "rhea" library which was being exported as `AmqpMessage` is now being removed, `Message` from "rhea" library will be imported as `RheaMessage` in service-bus and event-hubs to adhere to the convention for "Amqp" prefix being followed with the `AmqpAnnotatedMessage` or `AmqpMessageProperties` which are defined in the core-amqp.
2020-10-30 22:48:17 +00:00
Deyaaeldeen Almahallawi ae4d38476c
bump core-http version to 1.2.0 across the board (#12151) 2020-10-30 15:21:24 -04:00
Harsha Nalluru b6cb91da86
[Service Bus] StressTests scenarios (#11546) 2020-10-29 19:04:18 -07:00
Harsha Nalluru a42b7a6544
[Service Bus] Fix the flaky failure by increasing the max_wait_time (#12168)
### More info https://github.com/Azure/azure-sdk-for-js/issues/12000#issuecomment-716971749

By observation, this fix seems to have made all the entries in the matrix to be green and never failed in 1000 iterations. Hence, going with that and aborting the investigation.

Fixes #12000
2020-10-30 00:49:51 +00:00
Harsha Nalluru 1d5a5d66f1
[Service Bus] [Core AMQP] Merge AmqpMessage{Header|Properties} exported from both the libraries (#12091)
## Issue https://github.com/Azure/azure-sdk-for-js/issues/12004
### Previously
```ts
// Service Bus
AmqpAnnotatedMessage {
 header: AmqpMessageHeader;
 properties: AmqpMessageProperties;
}
AmqpMessageHeader {}
AmqpMessageProperties {}
```
```ts
// Core AMQP
      Imports 
       MessageProperties as AmqpMessageProperties and 
       MessageHeader as AmqpMessageHeader
      from rhea and re-exports them 
       (Have `underscore`s in the attributes instead of camel-case for the props from rhea)
// Exports new MessageProperties and new MessageHeader too (these are similar to AmqpMessage{Header|Properties} defined in service-bus)
```

### Updates
- ~~Re-exporting rhea types as `RheaAmqpMessage{Header|Properties}` instead of `AmqpMessage{Header|Properties}` from core-amqp~~ Removed these re-exports
- Renamed `Message{Header|Properties}` to `AmqpMessage{Header|properties}` in core-amqp (still being exported)
- Deleted the `AmqpMessage{Header|properties}` defined in service-bus and using `AmqpMessage{Header|Properties}` from core-amqp instead
- Re-exporting `AmqpMessage{Header|properties}` from core-amqp in service-bus
- Should we consider it non-breaking for core-amqp?
  - API shape has been changed for core-amqp
  - Event-hubs doesn't use any of the interfaces or types specified above, so it is not affected
  - Service Bus V1 uses amqp-common, so not affected
  - Only Service Bus V7 is affected(still in preview)
2020-10-29 21:44:47 +00:00
Richard Park 88ae7db998
[service-bus] Updating receiveMessagesStreaming sample to showcase proper error handling (#12111)
Updates the receiveMessagesStreaming sample to show how to handle errors. Also, fixed the existing samples so they're all up-to-date with the latest API

Fixes #12051, #8653, #7905
2020-10-29 13:56:43 -07:00
Harsha Nalluru e64a3aa3f6
[Service Bus] ATOM API - Update `update` methods with better param names/types and rephrased docs 👓 (#12013)
### Issue https://github.com/Azure/azure-sdk-for-js/issues/11860

We expect users to pass the modified properties object to the updateQueue method. However, we don't return just the properties object anywhere, we always return the properties wrapped in a response.
#### The intention behind this PR is to 
- remove the users' confusion on what should be passed into the update methods 
- give us more flexibility to add eTags support in a non-breaking way if the service gives better support for eTags!
2020-10-28 18:20:51 +00:00
Harsha Nalluru c0f767b62d
[Service Bus] More comments in the streaming receiver sample - V1 ✏ (#12024) 2020-10-28 17:52:55 +00:00
Harsha Nalluru 1e07862325
[Service Bus] Update _response with a smaller `HTTPResponse` object than the complete `HTTPOperationResponse` 🎡 (#12015)
* getHttpResponseOnly helper method

* Modify _response with getHttpResponseOnly

* formatting

* API Report

* changelog

* Richard's suggestion - Make _response non-enumerable
2020-10-27 18:20:59 -07:00
Harsha Nalluru 6bbabdd67b
[Service Bus] Remove userId on the top level message 🔨 (#12093) 2020-10-27 18:19:24 -07:00
Richard Park 6a042795b5
[service-bus] Make subscribe() more resilient against errors. (#11973)
Modifies `subscribe` to be more resilient against failures.

The general process is:
1. We always continually retry<> on init()
2. If a retry cycle fails (exhausts all retries configured via retryOptions) then we report the last error for that cycle.
3. We then begin a new cycle, running retry again.

The only way that a subscriber should quit is if the user passes and signals an AbortSignal.

This should make it much easier for people to write robust subscribe() implementations. A sample that shows how to handle some of the error codes will be coming shortly. This is merely the base.

Fix for #11719
2020-10-27 15:53:01 -07:00
Harsha Nalluru cb67b24d57
[Service Bus] Minor logging updates to connection reconnect ✒ (#12005)
* Update logs - onDetached

* log numbers too
2020-10-27 12:42:38 -07:00
Mohsin Mehmood aba7d47f9c
Servicebus remove viapartitionkey until Transactions are supported (#12026) 2020-10-26 11:28:11 -07:00
Sima Zhu 0ef2cda41c Fixed the http links 2020-10-25 21:16:42 -07:00
Ramya Rao 433905becc
Remove receiver overloads meant to hide settlement methods when using ReceiveAndDelete mode (#12014) 2020-10-22 21:58:54 -07:00
Mohsin Mehmood 0bc0c6c98f
[servicebus] CreateReceiverOptions, AcceptSessionOptions renamed (#11993) 2020-10-22 19:52:55 -07:00
Harsha Nalluru 91b20e398a
[Service Bus] Generic types for `Response`s for a cleaner API surface (#10491)
![image](https://user-images.githubusercontent.com/10452642/91238146-39d52c00-e6f1-11ea-9625-1655a8e8f9c8.png)
![image](https://user-images.githubusercontent.com/10452642/91238194-53767380-e6f1-11ea-9387-4ab00e6c5d00.png)
2020-10-22 22:41:15 +00:00
Sree bb9c532463
fix(service-bus): removing namespaceType from NamespaceProperties (#11995)
Addressing https://github.com/Azure/azure-sdk-for-js/issues/11956
2020-10-22 21:15:16 +00:00
Ramya Rao 714c5a1bc9
[Service Bus] Move settlement & renewLock methods from message to receiver (#11962) 2020-10-22 12:43:08 -07:00
Mohsin Mehmood f58d9256cb
[servicebus]scheduleMessages method swap enqueedTime and messages order (#11994)
Co-authored-by: Mohsin Mehmood <mohsin85mehmod@gmail.com>
2020-10-22 12:33:17 -07:00
Ramya Rao 20072d2a34
[Service Bus] Updating readme to match latest APIs (#11974) 2020-10-21 13:57:34 -07:00
Ramya Rao 112bb1da8c
[ServiceBus] Helper function to parse connection string (#11949) 2020-10-21 11:55:20 -07:00
Richard Park 2da4402790
[service-bus] Pass in ProcessErrorArgs to subscribe({ processError }) for extra diagnostics (#11927)
Users that want the simplest and most robust experience possible are encouraged to user `Receiver.subscribe` when writing their receive loops. This breaks things down to just passing us a couple of callbacks.

As part of an overall effort this commit adds in some extra context information (mimicking what we're doing in the .NET ServiceBusProcessor) to let users make better decisions in their processError handler by passing in a `ProcessErrorArgs` object, which gives the user some extra context about where the error originated from (`errorSource`) and the host and entity path.
2020-10-21 10:02:13 -07:00
Harsha Nalluru 383b4b0675
[Service Bus] Fix MaxListenersExceeded for management client (#11738)
* fix MaxListenersExceeded for management client

* comment update

* Add listener for receiver_error inside createRheaLink instead of checking for the count before adding the listener

* Typo

* changelog

* formatting

* changelog - mention the warning
2020-10-19 15:48:55 -07:00
Mohsin Mehmood 92affe2c10
[Service Bus] "message" word added to "createBatch", "CreateBatchOptions" and "tryAdd" (#11887) 2020-10-18 22:00:53 -07:00
Sima Zhu 3bae7c754d
Revert the formatting changes. (#11888) 2020-10-16 12:49:36 -07:00
Wes Haggard 35ae12c2c4 Fix anchor links so they work when converting to html 2020-10-16 09:34:53 -07:00
Mohsin Mehmood 1152ea0f9f
[Service Bus] Msg property renames, sku enums, mandatory sqlExpression in rules #11701 (#11782) 2020-10-15 22:13:15 -07:00