Kbase P20662: Sample code to list the Topics with QoP in the SonicMQ broke
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  06/03/2003 |
|
Status: Unverified
SYMPTOM(s):
Sample code to list the Topics with QoP in the SonicMQ broker
FIX:
// This code ilustrates a simply method of using the BrokerManager API
// to get a listing of the Topics with QoP
// More samples can be found under $SONICMQ/samples/BrokerManager
import progress.message.tools.*;
public class listQoPTopics implements progress.message.tools.IBrokerManagerListener
{
public void brokerConnectionDropped(java.lang.String host) {}
public void brokerEventNotification(java.lang.String description) {}
public void brokerShutdown(java.lang.String host) {}
public void brokerUndeliveredMsgNotification
(java.lang.String broker, java.lang.String messageID, java.lang.String destination, long timestamp, int reason, boolean preserved) {}
public listQoPTopics(String broker)
{
try
{
BrokerManager BKManager=new BrokerManager(this,broker,"Administrator","Administrator");
BKManager.connect();
System.out.println("Connected to:" + BKManager.getBrokerName());
String[][] topicos=BKManager.getTopicQoPs(null,false);
for(int i=0;i<topicos.length;i++)
for(int j=0;j<topicos[i].length;j++)
System.out.println(topicos[i][j]);
}
catch(Exception e)
{
e.printStackTrace();
}
}
public static void main(String[] args)
{
listQoPTopics e=new listQoPTopics("sonicbroker:2506");
System.exit(0);
}
}