isJSControlMessage will return true if this is an empty control status message and indicate what type of control message it is, say jsCtrlHB or jsCtrlFC
(msg *Msg)
| 2123 | // isJSControlMessage will return true if this is an empty control status message |
| 2124 | // and indicate what type of control message it is, say jsCtrlHB or jsCtrlFC |
| 2125 | func isJSControlMessage(msg *Msg) (bool, int) { |
| 2126 | if len(msg.Data) > 0 || msg.Header.Get(statusHdr) != controlMsg { |
| 2127 | return false, 0 |
| 2128 | } |
| 2129 | val := msg.Header.Get(descrHdr) |
| 2130 | if strings.HasPrefix(val, "Idle") { |
| 2131 | return true, jsCtrlHB |
| 2132 | } |
| 2133 | if strings.HasPrefix(val, "Flow") { |
| 2134 | return true, jsCtrlFC |
| 2135 | } |
| 2136 | return true, 0 |
| 2137 | } |
| 2138 | |
| 2139 | // Keeps track of the incoming message's reply subject so that the consumer's |
| 2140 | // state (deliver sequence, etc..) can be checked against heartbeats. |
no test coverage detected