I am investigating high availability of Oracle Streams Analytics (OSA).
Is it possible to access the server state, to check whether the server is Primary or Secondary, from within an OSA Application?
I have reviewed a lot of the Oracle documentation and not found reference to fail-over notifications
You can register for HA group notifications from the OSA cluster with the com.bea.wlevs.ede.api.cluster.GroupMembershipListener interface. A notification message is sent to the GroupMembershipListener every time membership of the group changes (a new server joins the cluster, or a server has left the cluster). The interface is detailed at: http://docs.oracle.com/cd/E72987_01/streamexplorer/api-javadocs/com/bea/wlevs/ede/api/cluster/GroupMembershipListener.html
The notification message includes a Configuration object, which allows access to the group coordinator (primary server) details. By checking the server's ID against the group coordinator's ID you can see if the OSA application is running on the primary or secondary server.
This is detailed in section 5.7 of the Oracle document on Administering Streams Analytics: http://docs.oracle.com/middleware/12212/osa/server-administer/GUID-77396001-EF1E-4FC8-8C44-A9DDD14A7DF2.htm#CEPAG816
The document states that the API for obtaining cluster group notifications has changed in version 12.2.1.2.0, however, no reference is made to the updated API. From testing on OSA 12c, the old API still works fine.