You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by di...@apache.org on 2020/03/10 11:08:30 UTC

[rocketmq-client-go] branch native updated: fix(heatbeat): change consume type to avoid fastjson decode error in lower broker version (#442)

This is an automated email from the ASF dual-hosted git repository.

dinglei pushed a commit to branch native
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git


The following commit(s) were added to refs/heads/native by this push:
     new fb29389  fix(heatbeat): change consume type to avoid fastjson decode error in lower broker version (#442)
fb29389 is described below

commit fb29389b7f5b7bd90d8943416e2b4e891ab499d5
Author: dinglei <li...@163.com>
AuthorDate: Tue Mar 10 19:08:20 2020 +0800

    fix(heatbeat): change consume type to avoid fastjson decode error in lower broker version (#442)
    
    * fix(heatbeat): change consume type to avoid fastjson decode error in lower broker version
    
    * style(format): format the code style in client.go
---
 internal/client.go | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/internal/client.go b/internal/client.go
index a84aa33..6e04615 100644
--- a/internal/client.go
+++ b/internal/client.go
@@ -449,7 +449,7 @@ func (c *rmqClient) SendHeartbeatToAllBrokerWithLock() {
 		consumer := value.(InnerConsumer)
 		cData := consumerData{
 			GroupName:         key.(string),
-			CType:             "PUSH",
+			CType:             "CONSUME_PASSIVELY",
 			MessageModel:      "CLUSTERING",
 			Where:             "CONSUME_FROM_FIRST_OFFSET",
 			UnitMode:          consumer.IsUnitMode(),
@@ -483,6 +483,13 @@ func (c *rmqClient) SendHeartbeatToAllBrokerWithLock() {
 					"brokerId":   id,
 					"brokerAddr": addr,
 				})
+			} else {
+				rlog.Warning("send heart beat to broker failed", map[string]interface{}{
+					"brokerName":   brokerName,
+					"brokerId":     id,
+					"brokerAddr":   addr,
+					"responseCode": response.Code,
+				})
 			}
 		}
 		return true