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

eventhub: application properties is not sent #8401

Closed
davidt99 opened this issue Nov 5, 2019 · 10 comments
Closed

eventhub: application properties is not sent #8401

davidt99 opened this issue Nov 5, 2019 · 10 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Event Hubs

Comments

@davidt99
Copy link

davidt99 commented Nov 5, 2019

On version 1.3.2, if I set an application properties key, the properties are not sent:

event_data = EventData(json.dumps({'test': 1}))
event_data.application_properties['foo'] = 'bar'
sender.send(event_data)

The thing is, if I initialize the application properties as a new dictionary, it works:

event_data = EventData(json.dumps({'test': 1}))
event_data.application_properties = {'foo: 'bar'}
sender.send(event_data)

The problem lies here:
https://github.com/Azure/azure-event-hubs-python/blob/master/azure/eventhub/common.py#L92 where this dict is not propagated to the Message object created in line #105
That repo is no longer maintained but I'm not interested in using a SDK which is still in beta status.

@kaerm kaerm added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Event Hubs labels Nov 6, 2019
@kaerm
Copy link
Contributor

kaerm commented Nov 6, 2019

@davidt99 thanks again :) - routing it the right way. //cc: @yunhaoling

@mayurid
Copy link
Member

mayurid commented Nov 6, 2019

@davidt99 : Thanks for bringing this to out attention. Looping in @KieranBrantnerMagee who will help you with this issue.
On a side note I want to ensure you that EventHubs 1.3.2 is not unmaintained and we as a team are supporting it. The code has moved from the location https://github.com/Azure/azure-event-hubs-python but a new location at https://github.com/Azure/azure-sdk-for-python/tree/eventhub_track1/sdk/eventhub/azure-eventhubs but unfortunately the readme was pointing to the code for the preview SDK. We have since updating this and you should have the right redirect.

@davidt99
Copy link
Author

davidt99 commented Nov 6, 2019

Thanks @mayurid!
I originally wanted to open a PR for this, I just didn't know where the code was.

@KieranBrantnerMagee
Copy link
Member

KieranBrantnerMagee commented Nov 7, 2019

No worries @davidt99, as we prepare for our upcoming releases there was some flux to normalize our repository/lib structure so things moved around, and the way the locations transitioned isn't always immediately obvious.

So as you correctly observed the underlying fix for this was rather straightforward. However, it turns out that wasn't the end of the rabbit hole. The underlying uamqp library version needs to be pulled forward to support application_properties being threaded through properly. However bringing that version forward revealed further fixes which will need to be applied within uamqp to unblock the us here. Luckily @yunhaoling had already come across this while handling other issues so we'll be combining forces to address this.

Will loop back asap as we learn more; thanks for your patience and again for reporting this.

@davidt99
Copy link
Author

davidt99 commented Nov 7, 2019

@KieranBrantnerMagee, thanks for the update. Can you elaborate on the issue you faced? I was able to send and read application properties.

@KieranBrantnerMagee
Copy link
Member

Of course.

When I went through to validate this scenario after applying the fix, I noticed there were other tests that evaluated app_properties, e.g. test_receive_batch_with_app_prop_sync

However, you'll notice that they are currently being skipped due to needing a bumped UAMQP version. Given that the fix to address your bits will need to be applied to the batching scenario as well for completeness/consistency, I had been hoping to reenable this to validate that I'm not introducing other issues, but this requires the aforementioned update lest it fails with errors expecting bytes vs eventData.

Given that Adam had already been looking into this, and that the bumped version is what will be used in our vnext APIS (additionally containing fixes to correct proper timeout threading) I erred on the side of applying the fix broadly and validating it in all flows in one go, to your point this may have been overkill for addressing just you and if there are any major blockers/issues with getting the full fix out I would fall back to the limited change to unblock you.

Let me know if that braindump/wall of text was unclear and I can try to clarify. You should also expect a PR to show up in this thread shortly which will contain both the fix for what you pointed out, and the underlying UAMQP version bump and fix. Feel free to eyeball that as an even more literal explanation of "what went wrong."

@davidt99
Copy link
Author

davidt99 commented Nov 8, 2019

@KieranBrantnerMagee Thanks for the clarification!

@annatisch
Copy link
Member

@KieranBrantnerMagee - are you able to confirm whether this issue is present in track 2?

@KieranBrantnerMagee
Copy link
Member

Validated that the issue is not present in T2. (To be precise in the presence of a double negative: T2 is good :) )

INFO:root:Got receiver event: {'body': 'batchId: 99, event: 69', 'application_properties': "{b'a': b'42'}", 'sequence_number': '969', 'offset': '73608', 'enqueued_time': '2019-11-27 17:50:31.215000'} With application properties: {b'a': b'42'}

@KieranBrantnerMagee
Copy link
Member

Closing this issue as the changes should have made it into 1.3.3.

Please don't hesitate to reopen and/or let us know if any further issues help or clarification is needed; Thanks to everyone involved!

openapi-sdkautomation-test bot pushed a commit to openapi-env-test/azure-sdk-for-python that referenced this issue Mar 24, 2020
Merge branch 'master' of https://github.com/Azure/azure-rest-api-specs into keyvault_multiapi_readme

* 'master' of https://github.com/Azure/azure-rest-api-specs: (101 commits)
  add cli.md for automation (Azure#8411)
  adjust assignment (Azure#8782)
  Remove Microsoft.Backup.Admin 2016-05-01 API version (Azure#8588)
  Updating global setting in PostgreSQL/MySQL readme file (Azure#8777)
  update package name and output folder in readme.typescript.md (Azure#8764)
  add package-2019-12 python define (Azure#8769)
  Fix Parameter Description for validate resource move (Azure#8524)
  Edit pass for GA swagger (Azure#8759)
  Update proxy.json (Azure#8596)
  Model enums that may change in the future as strings (Azure#8760)
  Add api-version 2019-11-01 for resources/subscriptions (Azure#8728)
  regenerated all-api-versions
  PrivateLinkResources for Microsoft.Automation (Azure#8369)
  add cli.md for serialconsole (Azure#8401)
  add cli.md for mariadb (Azure#8466)
  [Computer Vision] Create CV API v3.0-preview (Azure#7402)
  Publish Microsoft.ContainerService api-version 2020-03-01 (Azure#8756)
  Update swagger based on auto-gen process change. (Azure#8766)
  add assignment-bot config (Azure#8716)
  add tag package-2019-12 to batch (Azure#8751)
  ...
@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. customer-reported Issues that are reported by GitHub users external to the Azure organization. Event Hubs
Projects
None yet
Development

No branches or pull requests

9 participants