failover of activemq with visual cobol

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.

 

  • 0  

    Hi Priya,

    I know nothing about activeMQ or the configuraion that you are attempting to use but if you have an example of how it would be accomplished using a different programming language perhaps we could help you translate it to COBOL?

    Chris Glazier
    Rocket Software - Principal Technical Support Specialist
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button