How to extract the ConnectionFactory URL from the ConnectionFactory object without using the ConnectionFactoryInfo.getURL() method, which needs admin access?

How to extract the ConnectionFactory URL from the ConnectionFactory object without using the ConnectionFactoryInfo.getURL() method, which needs admin access?

book

Article ID: KB0089389

calendar_today

Updated On:

Products Versions
TIBCO Enterprise Message Service -
Not Applicable -

Description

Resolution:
Environment:
= = = = = =

1).  TIBCO Enterprise Message Service – All versions
2).  All Platforms

Resolution:
= = = = = =

1). The application can use ConectionFactoryInfo.getURL to achieve this. This method (ConectionFactoryInfo.getURL) is a part of the EMS admin API. You will need to have admin privilege to create an Admin connection to call getURL method.

2). You  can call  ConnectionFactory. toString() method on the QueueConnectionFactory object to get the URL. This will not need Admin access.

Example:

QueueConnectionFactory queueFactory = (QueueConnectionFactory)jndiContext.lookup("QueueConnectionFactory");
String result = queueFactory.toString();
System.out.println("Queue Connection Factory = " + result);

In this case, the value returned will resemble the following:

Queue Connection Factory = QueueConnectionFactory[URL=tcp://&lthostname>:7222;clientID=null;Properties={com.tibco.tibjms.multicast.enabled=true}]

Issue/Introduction

How to extract the ConnectionFactory URL from the ConnectionFactory object without using the ConnectionFactoryInfo.getURL() method, which needs admin access?