Our application uses Microfocus Visual cobol 7.0 version and frontend application is in JBOSS. We are connecting the frontend (UI screen) and backend (COBOL) through activeMQ version 5.16.1. In the current logic, the activeMQ address with port number of 61616 and user_id and password are hard-coded in cobol module to send/receive the value from frontend to cobol module and vice versa.
I am trying now to enable failover transport logic of activemq to acquire high availability. Logic can be included in the JBOSS configuration for failover as "<config-property name="ServerUrl">failover:(tcp://broker1_url:61616,tcp://broker2_url:61616)</config-property>". We need the failover logic in cobol code to test the HA.
Attached the code snippet of current logic for connecting activemq in cobol module. Please suggest me on how to add failover logic in COBOL module.
CONFIGURATION SECTION. repository. class AMQConnectClass as "$JAVA$com.activemq.AMQConnect" class AMQSenderClass as "$JAVA$com.activemq.AMQMqSender" class AMQReceiverClass as "$JAVA$com.activemq.AMQReceiver". ************************* WORKING-STORAGE SECTION. ************************* 01 connFactory Usage Object Reference. invoke AMQConnectClass "connect" using WS-USER-NAME WS-PASS-WORD WS-MQ-ADDRESS WS-PORT-NUMBER returning connFactory.