Unable to get broker client name


I am an Administrator and to ease of my life, I am trying to write an utility which will give the broker client information (name and size) using the following code.
But when executed, I am getting null values for both client name and size. Can anyone please help in finding the cause of not getting Broker client name and size. Being a non developer, I am not able to pinpoint the exact issue.
Need expert help. Thank you.


// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
String broker_host = IDataUtil.getString( pipelineCursor, “broker_host” );
String broker_name = IDataUtil.getString( pipelineCursor, “broker_name” );
//String clientID = IDataUtil.getString( pipelineCursor, “clientID” );

String client_group = "admin";
BrokerAdminClient client;
BrokerEvent event;
String[] str=null;
String message="";
String[] tmp_size= null;
String[] size= null;
String[] ClientID= null;
    int j=0;
    long queueDim = 0;

try {
            client= new BrokerAdminClient(broker_host, broker_name, null, client_group ,"Broker Description" ,null);
        	str= client.getClientIds();
            tmp_size= new String[str.length];
            size= new String[str.length];
            ClientID= new String[str.length];                
         	for (int i=0;i<str.length;i++){
	            try {
            	  event = client.getClientStatsById(str[i]);
                	  queueDim = event.getLongField("queueByteSize");
              	      size[i] = String.valueOf((event.getLongField("queueByteSize")/1048576));
                  	  if (queueDim > 1050000)
                          tmp_size[j] = size[i];
                          ClientID[j] = str[i];
	                }catch (BrokerException ex) {
                    System.out.println("error on destroying client"+ex);
    }catch(Exception e){

// pipeline
IDataCursor pipelineCursor_1 = pipeline.getCursor();
IDataUtil.put( pipelineCursor_1, “message”, message );
IDataUtil.put( pipelineCursor_1, “ClientID”, ClientID );
IDataUtil.put( pipelineCursor_1, “size_MB”, tmp_size);

please ignore this post, issue resolved.

If you can let us know what was the issue and how you fixed it will be very helpful for the forum members.

Hi Swapnil,

Is it due to you are not passing any input values or giving invalid inputs arguments. Can you kindly shed some light to better understand your requirement.