IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
  • 1.  Finding Broker queue length

    Posted Tue December 23, 2008 12:17 PM

    Hello All,

    Is there any std build-in service available for the fetching the broker queue length?

    Also just want know,is there any way to see the source code of the inbuild java service in webmMethods?

    Thanks,
    Mani


    #Universal-Messaging-Broker
    #broker
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Finding Broker queue length

    Posted Tue January 20, 2009 01:34 PM

    import COM.activesw.API.client.*;
    public class QueueCheck
    {
    public static void main(String args)
    {
    String broker_host = args[0];
    String broker_name = args[1];
    String client_group = args[2];
    String client_state_name = args[3];
    BrokerClient bc;
    BrokerEvent e, evt;
    BrokerConnectionDescriptor bcd;
    boolean shared = true;
    long sq_no;
    int i = 0;
    int len = 0;
    //create a broker connection descriptor
    bcd = new BrokerConnectionDescriptor();
    bcd.setStateShare(shared);
    bcd.setConnectionShare(true);
    //create a broker client
    try {
    bc = BrokerClient.newOrReconnect(broker_host,broker_name,client_state_name,
    client_group,“QueueCheck”,bcd);
    System.out.println(“Test Brokerclient connected”);
    } catch(BrokerException ex) {
    System.out.println(“Error on creating a broker client\n” + ex);
    return;
    }//create broker client

    //get the que Length
    try {
    len = bc.getQueueLength();
    System.out.println("Number of events in the queue: " + len);
    } catch(BrokerException ex) {
    System.out.println(ex);
    }//get que length
    
    //retreive the events
    e = new BrokerEvent[len];
    evt = new BrokerEvent[len];
    while(i<len)
    {
    try {
    e = bc.getEvents(1, -1, 6000);
    evt[i] = e[0];
    System.out.println("Received " + evt[i].getTypeName() + " event");
    System.out.println("" + evt[i]);
    i++;
    } catch(BrokerException ex) {
    System.out.println("getEvents() not successful...\n" + ex);
    return;
    }//try
    }//while
    
    //disconnect the brokerClient
    try {
    bc.disconnect();
    System.out.println("Disconnected TestSubscriber brokerClient");
    } catch(BrokerException ex) {
    System.out.println("Error on destroying the broker client\n" + ex);
    return;
    }//try
    

    }
    }


    #Integration-Server-and-ESB
    #Universal-Messaging-Broker
    #broker
    #webMethods


  • 3.  RE: Finding Broker queue length

    Posted Thu January 22, 2009 03:28 PM

    Hi Malani,

    Can we use this code as Java Service.
    If yes
    which package do i need to import in shared tab?
    Do i need to create broker client in code?
    What will be the input if i am using this code as java service.

    Actually i tried using this code as java service, but no luck :frowning:

    Your quick response will be highly appreciated.

    Regards,
    Mangat Rai


    #Integration-Server-and-ESB
    #broker
    #webMethods
    #Universal-Messaging-Broker


  • 4.  RE: Finding Broker queue length

    Posted Wed August 12, 2009 11:12 AM

    Yes this can be used as java service.
    You need to import COM.activesw.API.client.* package

    Can any one please let me know wthether broker queue length is same as broker queue depth.


    #Integration-Server-and-ESB
    #Universal-Messaging-Broker
    #broker
    #webMethods