Determining if a adapter is up or not urgent please

I need to determine if an adapter this or not running. But I want to determine it inside the integration associated with the same adapter.
For example before the passing the event to the configured operation, or when this in the try/catch, I can to capture the error message when the adapter this down. I do not need to stick the document … only I need that this integration indicate myself if the adapter this or not up for me to determine if this event sending or not … exist an API in java that should me permit to do this?

The integration script associated with the adapter is being run by the adapter itself. Thus, such a check will always succeed, or will never run.

You need to check adapter status outside of the adapter itself. Either with another adapter and/or with the ES tools/APIs.

Thanks Rob… I imagined it, is how to do ping in the same machine… now How I can chek the adapter status from other adapter?.. exist an Java API’s ?

I believe the Java Admin API provides facilities for this sort of thing. Or just add a “ping” type of operation to the adapter that you could do a request/reply on (perhaps something like that already exists).

Here is something I use.

BrokerClientInfo clientInfo = null;
clientInfo = c.getClientInfoById(AdapterName);
BrokerClientSession sessions = clientInfo.sessions;

if(sessions.length == 0){
//Adapter is down
}
else{
Adapter is up }
}

Hi Tim:
When I try the put this code, the debug output show me the error follow :
No Permission (109-1382): Operation failed because permission is denied. This operation requires administrative permissions.

I put in the AdapterName “SAP” for example… and I defined the c variable as BrokerAdminClient…
my code is:
BrokerAdminClient bac = new BrokerAdminClient(“aysen”,null,null,“dbAdapter”,“oracle”,null);
String clients = bac.getClientIds();
System.out.println(“client 00” +clients[0]);
for (int index = 0; index < clients.length; index++)
{
BrokerClientInfo info = bac.getClientInfoById(clients[index]);
System.out.println(“client " + clients[index] + " has " + info.sessions.length + " active sessions”);
if (info.sessions.length == 0)
{
System.out.println(clients[index] + " is not connected");
}
if (info.sessions.length != 0)
{

                System.out.println(clients[index] &#43; " is connected");  
            }  
    } 


but this create a new client and after i need destroy…
in this code I put :
getClientInfoById(Clientid);
as for example #gclient91-25066 because it is what returns to me in "clients[index] ".
… Do You know another example that can do like “ping” as Rob says with API’s Java?
thanks

I use the admin client group for my BrokerAdminClient. That should give you the rights you need and also since it’s a destroy on disconnect LifeCycle, that will take care of your lingering client as well. If you are using ssl you will also have to initialize a BrokerConnectionDescriptor and add it to your BrokerAdminClient constructor.