FileOutput Node - Java DNS caching pitfall - quick clarification and tips
ErikKirk 2000005NXT Visits (9542)
I was remodeling our kitchen and, as always, one thing led to another. I built drawers to replace some cabinets, converted some false drawers to real drawers, repaired shoddy electrical work, installed a cooktop, changed the gas lines, reconfigured a downdraft, fixed the plantation shutters, and so on. When it came time to spray the kitchen, I was up to my ears in tools. So, my wife helped me by putting the tools up. I haven't been able to find them since.
Luckily, the FileOutput node's behavior is more predictable when there's a failure. One failure you'll likely encounter is when the destination server cannot be found after the destination server has been failed-over to another server with the same host name but different IP address. This is because the new IP address for that server is not being resolved. While it's great you can find the file, wouldn't it be better to have the File Output node automatically find the destination server after a failover? Below, I provide some clarification and tips to hopefully lead you in the right direction.
The FileOutput node relies on Java™ to handle DNS queries. Essentially, we make the host name call to Java. Java makes a call to answer the DNS query and then caches the result. Java's default behavior for cached DNS entries is to keep them forever, which means the life of the calling process. In an environment where you failover the destination server to another server with the same host name, but different IP address, Java will never become informed of the new IP address and your application will fail to connect as a result. This is what happens to your message flow. Read on to find tips that will help you create an application that handles these problems.
You'll need to learn about Java DNS caching, how to configure DNS caching in a broker environment, and message flow behavior.
Tip 1. Learn about Java DNS caching:
Read through APAR PK20100. What you should get out of this link is how DNS entries can be cached never, for some period of time, or forever with forever being the default.
Tip 2. Configure Java DNS caching in a broker environment by using one of these two options:
Tip 3. Learn about message flow behavior:
Message flows provide default error handling described in section Default error handling in the WebSphere Message Broker information center.
However, this may not work for you. So the other option would be to wire the failure terminal on the FileOutput node and designing an error handling routine that considers the value you set for netw
Tip 4. Things to consider: