A Connection provides a ConnectionMetaData object. This object provides the latest version of JMS supported by the provider as well as the provider’s product name and version.
It also provides a list of the JMS defined property names supported by the connection.
Sample Code:
ConnectionMetaData metaData = connection.getMetaData();System.out.println("JMSVersion: " + metaData.getJMSVersion());System.out.println("JMSMajorVersion: " + metaData.getJMSMajorVersion());System.out.println("JMSMinorVersion: " + metaData.getJMSMinorVersion());System.out.println("JMSProviderName: " + metaData.getJMSProviderName());System.out.println("ProviderVersion: " + metaData.getProviderVersion());System.out.println("ProviderMajorVersion: " + metaData.getProviderMajorVersion());System.out.println("ProviderMinorVersion: " + metaData.getProviderMinorVersion());Enumeration JMSXPropertyNames = metaData.getJMSXPropertyNames();System.out.print("JMSXPropertyNames: ");while (JMSXPropertyNames.hasMoreElements()) { String propertyName = (String) JMSXPropertyNames.nextElement(); System.out.print(propertyName + ", ");}
Output:
JMSVersion: 1.1JMSMajorVersion: 1JMSMinorVersion: 1JMSProviderName: ActiveMQProviderVersion: 5.10.0ProviderMajorVersion: 5ProviderMinorVersion: 10JMSXPropertyNames: JMSXUserID, JMSXGroupID, JMSXGroupSeq, JMSXDeliveryCount, JMSXProducerTXID,