konlue opened a new pull request, #7722:
URL: https://github.com/apache/shenyu/pull/7722
Fixes #7696.
## Summary
The independent heartbeat channel reports
`InstanceTypeConstants.BOOTSTRAP_INSTANCE_INFO` as the instance type. That
constant is the payload key (`"bootstrapInstanceInfo"`) used by the WebSocket
map and the HTTP sync header; the actual type is `BOOTSTRAP_INSTANCE_TYPE`
(`"bootstrap"`), which the WebSocket collector and the HTTP long-polling
listener already report.
Because the admin instance identity includes the type and queries filter on
`instance_type`, the same bootstrap ends up with a second, invisible identity.
## Modifications
- Use `BOOTSTRAP_INSTANCE_TYPE` when building the periodic heartbeat payload
in `HeartbeatListener`.
- Add a regression test that runs the scheduled task, captures the JSON
payload passed to `RegisterUtils.doHeartBeat`, deserialises it, and asserts the
reported `instanceType`.
## Verifying this change
- [x] Red-green: with the original constant restored, the new test fails
with `expected: <bootstrap> but was: <bootstrapInstanceInfo>`; with the fix, it
passes.
- [x] Targeted tests pass:
```bash
./mvnw -B -ntp -pl shenyu-register-center/shenyu-register-client-beat test
-Dtest=HeartbeatListenerTest
```
10/10 green.
- [x] Checkstyle passes:
```bash
./mvnw -B -ntp -pl shenyu-register-center/shenyu-register-client-beat
checkstyle:check
```
clean.
## Notes
No migration for already persisted `bootstrapInstanceInfo` rows: this change
makes subsequent reports consistent with the other sync channels; normalising
historical rows (if desired) is a separate operational decision. The payload
key constants are untouched — only the `instanceType` value changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]