I want to know how can I check whether target system (Server) is up or not ? Please consider below scenario.
I am calling target application service using wm built in service pub.client.http. But before calling target application service, I need to check if target server is up or not. If up then only I need to call target service.
Please let me know how can I do that in webmethod. I am working on 9.12.
You can use client http service and use get method to query the resource is up and running.
Check with the target system if have any exposed any API or URL to query them to check if they are online. This service should be handled as a resource monitoring service and you can configure it via the trigger in pub-sub model.
As Mahesh suggested, the best way to ping a web application is to see if they have an API that you can hit, for example, the IS has a service called wm.server:ping. However, if you’re already going to invoke an endpoint on that application anyway, then why not just call it? If it works, great. If it doesn’t work, then you handle the exception. I don’t see any need to do a ping first.
I agree with Percio. Could you please share the business use case with us.
In some use cases, the availability of the target system will decide to process a transaction synchronously or asynchronously.
For example, in a web service wrapper ( web service to web service) design pattern, the transaction may be queued if the target server is not available.
To check if target server is up or not usually target application provides some resource URL.
I am interacting with sql Datbase. They don’t have any resource url. They execute some script to monitor thier databse.
How can I check if DB server is up or down through webMethod. By calling conenction string ? Can connection string be called in java service?
Any idea ? I am working on 9.12 IS. jdbc adapter version is 9.10 and fix is JDBC_9.10_Fix5