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

411 Коммитов

Автор SHA1 Сообщение Дата
Richard Park d0f6cc3372
Return the http status code information in the error text for the "Managers" (#258)
The various manager APIs all had their own error handling code, which would result in them occasionally obscuring the actual HTTP response error. 

We're now respecting the HTTP status codes and anything >= 400 causes us to fail with an actual error with text, rather than an empty error.

Fixes #229
2021-10-18 11:15:59 -07:00
Joel Hendrix 4974e2fd69
Update to latest go-amqp (#254)
Includes updates due to API breaking changes.
Cleaned up various linter bugs.
Removed some dead code.
2021-10-01 15:21:54 -07:00
Richard Park 0f63768a95
Update to latest version of azure-amqp-common-go (#250) 2021-09-03 17:36:02 -07:00
Richard Park e882857a71
Use link caching for $management operations (renew locks) (#248)
Make it so we use a single management link (most of the time) when doing dispositions or lock renewal (or other management related operations).

Also, added in a simple stress test. It's a bit manual at the moment, but it initiates 1000 concurrent renew lock calls at once, so it's a decent test of our response routing.
2021-09-02 13:56:35 -07:00
Joel Hendrix 47f464057d
Retry refreshing credentials (#245)
* Retry refreshing credentials

Don't exit the refresh goroutine on error, retry instead.

* update changelog and version info
2021-08-12 21:30:11 -07:00
Stéphane Erbrech d6775646da
defer close the link! (#244)
* defer close the link!

* nicer wrapping

* fold error handling to avoid variable shadowing and make scopes clearer

* fix return

* revert to simplest change possible
2021-08-12 17:26:26 -07:00
Richard Park cb1ca62fbe
Updating changelog for fixes for upcoming v0.10.15 release.
Adding in changelog for #241 fix and backfilling the previous releases changelog entries.
2021-08-09 11:52:05 -07:00
richardpark-msft a027c74654 Updating changelog text 2021-08-09 11:47:07 -07:00
richardpark-msft 0989672a03 Add in previous changelog entries 2021-08-09 11:45:03 -07:00
richardpark-msft 124ebad161 Fixing incorrect version number 2021-08-09 11:39:55 -07:00
richardpark-msft e806614069 Adding in changelog for #241 fix. 2021-08-09 11:38:20 -07:00
Richard Park b1b6402dea
Updating to latest go-amqp to fix issues with deferring messages #242
Updating go.mod to use latest version of go-amqp (with fix in https://github.com/Azure/go-amqp/pull/43) to fix an issue with deferring messages.

When we were sending sequence numbers (via properties) in the message they would be serialized incorrectly since the code was downsizing the type to an int8 without doing proper limit checking. This would result in us sending "negative" sequence numbers.

The customer saw this with a dead letter queue (as did I) but I think that was just a coincidence - it should happen with any 'int64 array' properties.

Fixes #241
2021-08-09 11:30:57 -07:00
richardpark-msft e6b94fd3e7 go mod tidy! 2021-08-09 11:15:28 -07:00
richardpark-msft 5ef0939d76 Updating go.mod to use latest version of go-amqp (with fix in https://github.com/Azure/go-amqp/pull/43), which fixes #241 2021-08-05 15:56:03 -07:00
Richard Park d256ec3683
Allow for passing in skip and top parameters to calls that list subscriptions, queues and topics #234
The current implementation that lists resources (using ATOM) doesn't allow passing in skip, which would allow you to list more than the default page size of 100 items.

This PR adds in skip (and top, which controls the size of the page) for listing queues, topics and subscriptions which allows you, over multiple calls and incrementing skip, to get the list of all entities.

Fixes #231
2021-07-13 14:41:08 -07:00
Richard Park 82d7a09765 Show the verbose test output as well (this is used for CI) 2021-07-13 21:14:00 +00:00
Richard Park 5da6b808fc Do the check proactively and avoid encoding. 2021-07-13 20:36:16 +00:00
Richard Park 36a7816e06 Fixing the tolist/list thing properly. 2021-07-13 20:01:40 +00:00
Richard Park 483591c307 Looks like list() is gone and tolist() is the chosen one. Switch over. 2021-07-13 19:41:57 +00:00
Richard Park 926b3ae6d0 Fixing lint errors and changing names to be more accurate (baseUrl -> basePath) 2021-07-13 19:36:21 +00:00
Richard Park d5e4f6cdb7 Allow passing in top and skip parameters to the resource listing methods for queues, topics and subscriptions.
By default, Service Bus's ATOM API will return 100 items in a single page. Top and skip allow you to continue paging through any additional items beyond those first set, as well as controlling the number of entries that are retrieved at a time.

Also, adding in tests.
2021-07-13 03:04:03 +00:00
Joel Hendrix 80fa1bca8e
Fix panic when specifying a nil session ID (#232)
Propagate the session ID selected by the broker when a nil session ID is
specified.  This requires an updated go-amqp to work.
Removed validation of EnqueuedSequenceNumber as it's not guaranteed to
be returned.
2021-06-23 17:33:48 -07:00
Robert Zakrzewski 319bf88d37
Add associate-link-name property to RenewLocks function. (#225)
* Add associated-link-name property to RenewLocks message. Fix connection idle timeout for messages with >=10minsprocessing time.

* Upgrade go-amqp

* Make message.getLinkName package level function

* only set associated link name if available

Co-authored-by: Robert Zakrzewski <Robert.Zakrzewski@tomtom.com>
Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>
2021-05-06 14:33:15 -07:00
Stéphane Erbrech 73da33658f
fix lock renewal test to take into account amqp flow (#213)
* prove faster lock proof

amqp now takes message dispostion into account to adjust the flow
this means that no credits are provided to the sender
until a disposition is sent for a given message.

previous test handled messages concurrently without completing them
and this won't work anymore, unless the prefetch is set higher.

* fix gofmt

* add MIT header

* bump go-amqp and switch to t.Logf()

Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>
2021-03-04 15:07:13 -08:00
Stéphane Erbrech bb0d9d0bf8
bump go-amqp (#214) 2021-02-25 09:56:12 -08:00
Joel Hendrix 4cf438ff11
Update version number 2021-02-24 14:01:10 -08:00
Stéphane Erbrech f536d5cb76
Use amqp HandleMessage Func (#207)
* use amqp HandleMessage Func

* add missing MIT license header

* bump amqp
2021-02-24 13:59:52 -08:00
Joel Hendrix 9ac8a371a6
Fix potential deadlock in receiver (#211)
Updated makefile with latest path to golint
2021-02-18 07:57:16 -08:00
Joel Hendrix 16315f0a5a
Update version number 2021-02-17 09:16:07 -08:00
Joel Hendrix 296ac2ca91
Add recovery mechanism to rpcClient (#206)
* Add recovery mechanism to rpcClient

RPC operations will now attempt to recover, similar to sender and
receiver, in case of failure.
Fixed Recover() to atomically rebuild the client.
Close() will now close auth auto-refresh.

* add transient error checks

* don't recover on a closed connection

use common.Retry() for Recover() retry loop
added recovery tracing and debug logging

* improve some doc comments

* avoid potential for infinite loop
2021-02-17 07:53:04 -08:00
Joel Hendrix f9ea40a809
Consolidate auth auto-refresh (#205)
* Consolidate auth auto-refresh

Moved the enabling of auth auto-refresh to when calling
negotiateClaim().  This ensures that all code paths that require
authentication will enable auto-refresh.
Ensure that there's only one goroutine that performs the refresh.
Changed auth refresh interval to 15 minutes per guideance from SB.
Exit auth auto-refresh goroutine if it fails; this should help trigger
recovering of clients due to failed authentication.

* cancel auth when closing RPC client

* reuse existing timer

* reset the the auto-refresh guard on exit

The Recover() case will rebuild the AMQP client which means a new
refresh goroutine should be started.
Use a channel to synchronize with the refresh goroutine exiting.

* improved refresh goroutine synchronization

* don't exit refresh goroutine on refresh failure

* rename vars

* simplify timer
2021-02-09 16:13:35 -08:00
Paul Miller 12810d63bc
tell users they can't go higher than 5 minutes (#202)
* tell users they can't go higer than 5 minutes

* Update version in namespace.go

Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>
2021-01-26 09:23:57 -08:00
catalinaperalta 78c960db00
Merge pull request #201 from gavinfish/sender-retry
Only retry with retryable amqp errors for sender
2021-01-15 11:29:40 -05:00
drfish 9d82129c2e Only retry with retryable amqp errors for sender 2021-01-11 20:57:18 +08:00
Joel Hendrix 705d23958e
Update Version to latest prerelease 2020-12-02 08:30:53 -08:00
Joel Hendrix 4dea55cd25
Fix nil error dereference (#199)
Store result of ctx.Err() in err variable before dereferencing.
2020-12-02 08:09:10 -08:00
Chris ff0e3f064d
Fix for Websocket behind Proxy Issue (#196)
* Fix lastError race

* Move websocket pkg out of std lib to deal with proxy.

* Add WebsocketEOF to connection closed error check.

* add comment

* added ctx to flow to ns.newClient

Co-authored-by: Alexander Pashkov <alexpashkov123@gmail.com>
Co-authored-by: Chris <christopher.mcmillon@halliburton.com>
Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>
2020-12-02 07:58:44 -08:00
Stéphane Erbrech c0e1f593d7
Add AzureEnvironment namespace option and use its definition (#192)
* add AzureEnvironment option and use its definition

* gofmt

* fallback to previous behavior. added TODO waiting for autorest config

* add test

* go fmt

* use environment value for resourceURI

* add name to the option

* separate token provider creation

* removed redundant error check

Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>
2020-12-01 08:28:28 -08:00
Joel Hendrix 040d6776ea
update CI to latest two Go versions (#195)
* update CI to latest two Go versions

* fix gocyclo
2020-10-23 13:21:01 -07:00
Scott Beddall c6cb351fc4
Update to use build-in env (#190)
* take advantage of environment setting. prep for move to kv

* use client ID and secret specific to SB

Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>
2020-09-21 11:48:46 -07:00
Joel Hendrix 27d94af5a7
Fix hang when closing reciever (#188)
The fix in (#187) introduced a hang when closing the receiver.
Don't hold the read lock before calling Receive() as it blocks.
Return a connection closed error.
2020-08-18 18:15:20 -07:00
Joel Hendrix 4ace8d41da
Recover must rebuild the link atomically (#187)
Take the read lock when accessing r.receiver
2020-08-18 16:26:10 -07:00
Mitsuo Heijo 93f17b29c0
update dependencies (#179)
related #173 #175

Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>
2020-08-10 13:39:14 -07:00
Joel Hendrix 97623891c2
fix test reporting for integration pipeline (#185) 2020-08-10 13:16:28 -07:00
Joel Hendrix 2c849d6018
A few test case fixes (#184)
Swapped incorrect ordering of expected/actual args to assert.Equal.
Fixed FalseFilter comparision in
testSubscriptionWithDefaultRuleDescription
2020-08-10 12:43:15 -07:00
Joel Hendrix ef6b271248
fix working dir for integration tests CI (#183) 2020-08-10 11:06:21 -07:00
Joel Hendrix 7c8a18b38e
add missing vars to integration tests CI (#182) 2020-08-10 10:52:40 -07:00
Joel Hendrix 1ec3441a69
only run unit tests in CI (#181) 2020-08-10 10:26:47 -07:00
Joel Hendrix 3e0b6bac2c
Replace travis CI with Azure DevOps (#180) 2020-08-10 10:01:38 -07:00
norgitam 348d3265e8
Add subscription option to set a default rule (#172)
* add SubscriptionWithDefaultRuleDescription as SubscriptionManagementOption

* set default rule name to rule0 instead of non working $Default

* add test for SubscriptionWithDefaultRuleDescription

* allow user specified rule name for SubscriptionWithDefaultRuleDescription

* update changelong and version info

Co-authored-by: Nor Amelia Stenberg <nor@xinxidi.net>
Co-authored-by: Joel Hendrix <jhendrix@microsoft.com>
2020-07-08 08:37:18 -07:00