Posted: Sun Sep 25, 2005 11:38 pm Post subject: Can one detect the a flow has stopped
Apprentice
Joined: 17 Dec 2003 Posts: 41
I have a custom TCPIP input node built in Java that "caches" connections to the other end. It does this to allow long running connections between systems.
Also the design calls for a peer to peer type of arrangement between sending and receiving systems and there is only ever one thread instance of the input flow.
However if I stop the message flow, I dont get an event on the input node per se and hence I cant "clear" my cache of TCPIP connection information.
I have implemented the onDelete() method which cleans up but this only happens if I delete the flow.
According to the doco, it seems
Quote:
A Java user-defined input node is destroyed when the node is deleted or the broker is shut down. You do not need to include anything in your code that specifies the node should be physically deleted, because this can be handled by the garbage collector.
However, if you want to be notified that a node is about to be deleted, you can use the onDelete method. You might want to do this if there are resources other than those that will be garbage collected that you want to delete. For example, if you have opened a socket, this will not be properly closed again when the node is automatically deleted. You can include this instruction in your onDelete method to ensure that the socket is properly closed.
Is there a way to detect that the flow is in fact not running and hence clean up any cached resources.
Is there an event for start and stopping of the flow?
OK what I thought I could do was "subscribe" to the operational events from within my Java node and then be told when the message flow has started and stopped.
I quick play around with RFHUtil pub/sub and the following topic :
Cool I can tell if flow has been stopped or started. However I cant see a easy way to resolve the flow UUID. Without the name I can be sure that the flow being stopped is the flow the node is contained within.
I know the name of the broker/execution group/flow name from the Java Node API however it does not provide the UUID.
Does any one know how I can resolve the UUID nack to the flow name?
I am hoping I can do this via some "magic" pub/sub topic request to the broker?
I have a sneaking susspicion that this info is in the broker database but I would rather not read the DB if I dont have to (for performance and complexity reasons mainly)
Some management tools such as the Candle Omegamon agent for WBI broker seem to be able to get this flow information.
From what I can infer they dont do this via database lookup which would suggest to em that there is a "magic" topic name that one can send to the broker to get the state and names of flows etc... Any clues IBMer's
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum