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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Java API:

    Posted 08/23/17 05:45 PM

    Using the UM Java API, I am attempting to return durable subscriber information which includes “Last Read Time”. It appears I need to obtain the “connections” for a nDurableNode instance in order to obtain the “Last Read Time” information (that information on the nDurableNode instance appears to always 0). However, when I execute the .getConnections() method, I do not get any connections.

    Below is my code written as an IS Java Service (currently just returning a list of information for debugging). Any ideas on what I may be doing incorrectly would be most appreciated. Thank you!

    	public static final void getTriggerInfo(IData pipeline) throws ServiceException {
    String[] RNAME = {"nsp://xmedid1:9087"};
    nSessionAttributes nsa = null;
    nSession lSession = null;
    nRealmNode rNode = null;		
    String[] channelNames = null;
    ArrayList<String> infoArray = new ArrayList<String>(100);
    
    try {
    nsa = new nSessionAttributes(RNAME);
    rNode = new nRealmNode(nsa);
    
    lSession = nSessionFactory.create(nsa);
    lSession.init();
    
    nChannelAttributes[] channelList = lSession.getChannels();
    for (int j = 0; j < channelList.length; j++) {
    
    nTopicNode topic = (nTopicNode)rNode.findNode(channelList[j].getFullName());
    List<nDurableNode> durableList = topic.getDurableList();
    Iterator<nDurableNode> itd = durableList.iterator();
    while (itd.hasNext()) {
    nDurableNode durable = (nDurableNode)itd.next();
    infoArray.add("Durable: " + durable.getName());
    
    Iterator<nDurableConnectionNode> itc = durable.getConnections();
    while (itc.hasNext()) {
    nDurableConnectionNode durableConnection = (nDurableConnectionNode)itc.next();
    infoArray.add("Durable connection: " + durable.getName() + ", " + durableConnection.getId() + ", " + durable.getDepth() + ", " + new Date(durableConnection.getLastReadTime()));				
    }
    }											
    }						
    
    if (infoArray.size() > 0) {
    channelNames = new String[infoArray.size()];
    infoArray.toArray(channelNames);				
    }			
    
    IDataCursor idcin = pipeline.getCursor();
    IDataUtil.put(idcin, "channelNames", channelNames);
    idcin.destroy();
    
    lSession.close();
    
    } catch (Exception e) {
    IDataCursor idcin = pipeline.getCursor();
    IDataUtil.put(idcin, "exception", e.toString());
    idcin.destroy();
    }

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


  • 2.  RE: Java API:

    Posted 08/27/17 11:47 AM

    I once had to write a similar program and had to use the Eclipse Debugger to see what fields are present and to find out their types. If I don’t forget I’ll write you later (approx. 10 days).


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