Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ServiceBus] Track2 - Re-expose AMQP details on message #13297

Closed
KieranBrantnerMagee opened this issue Aug 24, 2020 · 0 comments · Fixed by #13564
Closed

[ServiceBus] Track2 - Re-expose AMQP details on message #13297

KieranBrantnerMagee opened this issue Aug 24, 2020 · 0 comments · Fixed by #13564
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Service Bus

Comments

@KieranBrantnerMagee
Copy link
Member

Given the ask to allow access to AMQP properties such as annotations and headers, there are two proposals at hand.

Proposal 1
Flat object.

Pros:

  • fewer new object concepts
  • less depth
  • all props immediately visible.

Cons:

  • all props immediately visible.
  • amqp/non-amqp confusion at top level
class PeekedMessage(Message):
    def __init__(self, message : AMQPMessage, ...):
        ...
        self.annotations = message.annotations # type: dict[str,str]
        self.headers = message.annotations # type: dict[str,str]
        ...

# accessed as:
message.annotations["foo"]="bar"

Sub-Proposal 1-B

As above, but amqp_[headers, annotations, etc] naming.

Proposal 2
AMQP sub-object. echoes the design of "ServiceBusReceiver.Session" for function-specific grouping if niche functionality.

Pros:

  • logical encapsulation, more communicative.
  • keeps core message surface area cleaner.

Cons:

  • additional layer of depth/additional concept.
  • if we ever introduce circular dependencies between these props, (e.g. A sets B, B sets A) it'll be problematic.
class AMQPMessageProperties(Object):
    def __init__(self, annotations, headers, ...)
        ...
        self.annotations = annotations # type: dict[str,str]
        self.headers = annotations  # type: dict[str,str]
        ...

class PeekedMessage(Message):
    def __init__(self, message : AMQPMessage, ...):
        ...
        self.amqp = AMQPMessageProperties(message.annotations, message.headers, ...) # type: AMQPMessageProperties
        ...

# accessed as:
message.amqp.annotations["foo"] = "bar"
@KieranBrantnerMagee KieranBrantnerMagee added Service Bus Client This issue points to a problem in the data-plane of the library. labels Aug 24, 2020
@KieranBrantnerMagee KieranBrantnerMagee added this to the [2020] September milestone Aug 24, 2020
@KieranBrantnerMagee KieranBrantnerMagee self-assigned this Aug 24, 2020
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this issue Mar 22, 2021
Threis/cv 32 ga (Azure#13297)

* Create Base CV 3.2 config

* Add language and start updating examples

* Add model version, corrct other smaller elements

* Tweak language code formatting and description

* Correct Read available resource version

* Attempt to fix failing build

* Ensure parity with ComputerVisionErrors

* Add model version for vision

* Correct ModelVersion to model-version

* Fix JSON formatting error

* Update query param name for model version to "model-version"

* Remove unused error codes from OCR's supported list

* Fix failing tests on OCR operation

* Split vision and ocr Model-Version into to separate elements

* Fix case sensitivity issue

* Add parent "error" object, remove requestId from ComputerVisionError object

* Fix the number of returned captions (maxCandidate is set to 1 so API should return only one caption)

Co-authored-by: bob <bob@bob.com>
Co-authored-by: Ryogo Kanatani <ryogok@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Service Bus
Projects
None yet
1 participant