Type: New Feature
Affects Version/s: 2.0
Fix Version/s: None
JMS topics and queues both have names that are accessible with getTopicName() and getQueueName(), but for applications where the type of destination (topic or queue) is configurable - which I would consider a good application - it's difficult to get the actual destination's name.
An ugly typecast or something similar must be used:
What I'm proposing is simply a common Destination.getName() method so this code becomes nicer:
The implementation of Destination.getName() is trivial for Topic and Queue.
I can understand the objection of saying: "'Destination' is just a marker interface and JMS abstracts from the actual topic/queue name, these names shouldn't matter."
But then, why is there getQueueName()/getTopicName() in the first place?
I find this name very useful in order to debug or sort message streams into buckets and it would be nice if this name will be simpler to get by.