code: public String getDestinationName(Destination destination) {
          try {
              if (destination instanceof Queue) {
                  return ((Queue) destination).getQueueName();
              } else if (destination instanceof Topic) {
                  return ((Topic) destination).getTopicName();
              } else {
                  return destination.toString();
              }
          } catch (JMSException e) {
              log.error("Unable to resolve destination name", e);
              return "";
          }
      }
docs: Get the destination name (either a queue name or a topic name).
  @param destination
  @return the destinationName