Fix: dubbo version
diff --git a/const.go b/const.go
index 6d51f67..1a5a796 100644
--- a/const.go
+++ b/const.go
@@ -200,7 +200,6 @@
FLAG_EVENT = byte(0x20) // for heartbeat
SERIAL_MASK = 0x1f
- DUBBO_VERSION = "2.5.4"
DUBBO_VERSION_KEY = "dubbo"
DEFAULT_DUBBO_PROTOCOL_VERSION = "2.0.2" // Dubbo RPC protocol version, for compatibility, it must not be between 2.0.10 ~ 2.6.2
LOWEST_VERSION_FOR_RESPONSE_ATTACHMENT = 2000200
diff --git a/request.go b/request.go
index 8e0fb26..5722b44 100644
--- a/request.go
+++ b/request.go
@@ -176,7 +176,6 @@
err error
types string
byteArray []byte
- version string
pkgLen int
)
@@ -221,7 +220,9 @@
}
// dubbo version + path + version + method
- encoder.Encode(DUBBO_VERSION)
+ // org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeChannel
+ // v2.7.1 Line 92
+ encoder.Encode(DEFAULT_DUBBO_PROTOCOL_VERSION)
encoder.Encode(service.Path)
encoder.Encode(service.Version)
encoder.Encode(service.Method)
@@ -238,9 +239,8 @@
request.Attachments[PATH_KEY] = service.Path
request.Attachments[GROUP_KEY] = service.Group
request.Attachments[INTERFACE_KEY] = service.Interface
- if len(version) != 0 {
- request.Attachments[VERSION_KEY] = version
- }
+ request.Attachments[VERSION_KEY] = service.Version
+
if service.Timeout != 0 {
request.Attachments[TIMEOUT_KEY] = strconv.Itoa(int(service.Timeout / time.Millisecond))
}
@@ -325,6 +325,7 @@
return perrors.WithStack(err)
}
if v, ok := attachments.(map[interface{}]interface{}); ok {
+ v[DUBBO_VERSION_KEY] = dubboVersion
req[6] = ToMapStringString(v)
return nil
}