Search code examples
thresholdsolacemessage-bus

How to publish Threshold event of combined connections to Message Bus?


What's the topic of connection threshold events? How do I listen to connection count threshold events over the message bus, and how do I figure out what is the current connection count?


Solution

  • Connection threshold events can be published over the message bus to the following topics:

    #LOG/WARNING/VPN/<router-name>/VPN_VPN_CONNECTIONS_HIGH/<vpn-name> when the connection count exceeds the high threshold.

    #LOG/INFO/VPN/<router-name>/VPN_VPN_CONNECTIONS_HIGH_CLEAR/<vpn-name> when the connection count goes below the clear threshold.

    If desired, you can apply wildcards to the topics. For example, #LOG/*/VPN/<router-name>/VPN_VPN_CONNECTIONS*/<vpn-name>.

    Note that you will need to fill in <router-name> and <vpn-name> with appropriate values.


    In order to have the connection count threshold events published over the message bus, you will need to do the following:

    a. Configure the VPN to "Publish Message VPN Event Messages".

    b. Your application needs to subscribe to the topic for connection threshold events.


    In order to figure out the current connection count, you will need to send a SEMP over message bus query.

    a. Enable SEMP over Message Bus Show Commands on the VPN.

    b. Send a SEMP over Message Bus query. There's an SempGetOverMB sample in the API with detailed instructions to do this. You can also refer to the documentation for details.

    <rpc semp-version="soltr/7_2">
    <show>
    <message-vpn>
    <vpn-name>default</vpn-name>
    </message-vpn>
    </show>
    </rpc>
    

    c. Parse the XML based response.

    <rpc-reply semp-version="soltr/7_2">
    <rpc>
    <show>
    <message-vpn>
    <vpn>
    <name>default</name>
    <connections-service-smf>3</connections-service-smf>
    <connections-service-web>0</connections-service-web>
    <connections-service-rest-incoming>0</connections-service-rest-incoming>
    <connections-service-mqtt>0</connections-service-mqtt>
    <connections-service-rest-outgoing>0</connections-service-rest-outgoing>
    <max-connections>10</max-connections>
    <max-connections-service-smf>9000</max-connections-service-smf>
    <max-connections-service-web>9000</max-connections-service-web>
    <max-connections-service-rest-incoming>9000</max-connections-service-rest-incoming>
    <max-connections-service-mqtt>9000</max-connections-service-mqtt>
    <max-connections-service-rest-outgoing>6000</max-connections-service-rest-outgoing>
    
    ... Removed non-relevant portions for clarity ...
    
    </vpn>
    </message-vpn>
    </show>
    </rpc>
    <execute-result code="ok"/>
    </rpc-reply>
    

    Note that there is a system limit of 10 SEMP poll requests per second, and some topics should not be polled. Refer to the documentation for details.