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

Amqnet 834 add better access to ConsumerDestination #89

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Jefwillems
Copy link
Contributor

see: https://issues.apache.org/jira/browse/AMQNET-834

This pull request adds a makes the property "consumerDestination" public. This enables applications to view the fully qualified destination name, when subscribed to a topic, instead of only the topic address.

E.g.
now, when you are subscribed to a topic "topic.my.topic::consumer.topic.my.topic", and you receive a message with nms. When you look at NMSDestination on the message, you'll only see "topic.my.topic"
With this pull request, and possible an extra one to nms-api (for the IMessage type), you can look at NMSConsumerDestination, and you'll see "topic.my.topic::consumer.topic.my.topic".

The only way we can get the fully qualified name now, is trough reflection:

var prop = msg.GetType()
                    .GetProperty("consumerDestination", BindingFlags.NonPublic | BindingFlags.Instance);

@michaelpearce-gain
Copy link
Contributor

michaelpearce-gain commented Sep 8, 2023

@Jefwillems technically the "queue" part (in artemis its modelled as a queue on a multicast address, other brokers (solace, swiftmq etc) may model it differently so need to be careful on naming) in the fqqn on a topic is actually in NMS/JMS parlance is the subscription name.

As well the subscription name is tied to the consumer, as such whilst the message has this internally in amqp implementation of nms, in other nms clients it may not be there, if you need to read back the subscription name, this would have to be off the consumer object, i would suggest a better "NMS/JMS" way would be to expose a getter on the IConsumer in NMS API, to get the JMS2 subscription name, this then would be possible to implement in other implementations of NMS, such as openwire one/when they support sharedsubs.

@michaelpearce-gain
Copy link
Contributor

btw sorry for slow response, summer kids holidays....

@michaelandrepearce
Copy link
Contributor

@Jefwillems i guess my worry is exposing this at the nms api layer, what your doing peeking into something which is amqp specific..... not sure how much would want end users poking at internals, appreciate you know the internals as contributor to this project and you know the objects, and thus why you know you can "steal" this information from the internal details.

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.

3 participants