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

Update ReadAny to skip over lists and maps #372

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

ngbrown
Copy link
Contributor

@ngbrown ngbrown commented Apr 11, 2024

Addresses #371 enough to at least get the client working again with RabbitMQ 3.13.

For now, this just returns null as the value for lists and maps. The project can decide how to correctly handle this, since the x-received-from message annotation has the following structure:

{
  "x-received-from": [
    {
      "uri": "amqp://something",
      "exchange": "events",
      "redelivered": true,
      "cluster-name": "rabbit@something",
      "vhost": "./"
    }
  ]
}

The x-shoveled message annotation has the following structure:

{
  "x-shovelled": [
    {
      "shovelled-by": "rabbit@820c50d2107b",
      "shovel-type": "dynamic",
      "shovel-name": "events-from-...",
      "shovel-vhost": "./",
      "src-uri": "amqp://somewhere",
      "dest-uri": "amqp://",
      "src-exchange": "events",
      "src-exchange-key": "#",
      "dest-exchange": "events"
    }
  ]
}

But since the message annotation of AMQP 1.0 is completely flexible, this client shouldn't lock into just the current value types. Maybe return generic List<object> and Dictionary<object, object>?

I have a patch-any-2 branch toward that end, but no tests, and breaking API changes to enable use of the existing Map<>...

@Gsantomaggio
Copy link
Member

Gsantomaggio commented Apr 12, 2024

According to the AMQP 1.0 specification, application properties are only flat values; annotations can be flat and list.

https://www.rabbitmq.com/docs/conversions#amqpl-amqp

The current parser handles all the maps in the same way. We'd need to distingue when we are parsing:
application properties or annotations in the first case your fix is correct. In the second case, we should handle it ( like you are doing in the other branch )

and breaking API changes to enable use of the existing Map<>

I want to avoid breaking changes. I'd merge and release this fix for the moment. Then, implement the annotation list.

Thank you for the fix

Copy link
Member

@Gsantomaggio Gsantomaggio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is ok for the Application Properties

@Gsantomaggio Gsantomaggio merged commit df102c4 into rabbitmq:main Apr 12, 2024
2 checks passed
@Gsantomaggio
Copy link
Member

FYI for the moment : https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/releases/tag/v1.8.3

Thank you for the fix

@ngbrown ngbrown deleted the patch-any branch April 15, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants