@@ -251,6 +251,13 @@ public void handle(Client client, int frameSize, ChannelHandlerContext ctx, Byte
251
251
}
252
252
253
253
abstract int doHandle (Client client , ChannelHandlerContext ctx , ByteBuf message );
254
+
255
+ protected void logMissingOutstandingRequest (int correlationId ) {
256
+ LOGGER .warn (
257
+ "Could not find outstanding request with correlation ID {} ({})" ,
258
+ correlationId ,
259
+ this .getClass ().getSimpleName ());
260
+ }
254
261
}
255
262
256
263
private static class ConfirmFrameHandler extends BaseFrameHandler {
@@ -670,7 +677,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) {
670
677
OutstandingRequest <QueryPublisherSequenceResponse > outstandingRequest =
671
678
remove (client .outstandingRequests , correlationId , QueryPublisherSequenceResponse .class );
672
679
if (outstandingRequest == null ) {
673
- LOGGER . warn ( "Could not find outstanding request with correlation ID {}" , correlationId );
680
+ logMissingOutstandingRequest ( correlationId );
674
681
} else {
675
682
QueryPublisherSequenceResponse response =
676
683
new QueryPublisherSequenceResponse (responseCode , sequence );
@@ -695,7 +702,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) {
695
702
OutstandingRequest <QueryOffsetResponse > outstandingRequest =
696
703
remove (client .outstandingRequests , correlationId , QueryOffsetResponse .class );
697
704
if (outstandingRequest == null ) {
698
- LOGGER . warn ( "Could not find outstanding request with correlation ID {}" , correlationId );
705
+ logMissingOutstandingRequest ( correlationId );
699
706
} else {
700
707
QueryOffsetResponse response = new QueryOffsetResponse (responseCode , offset );
701
708
outstandingRequest .response ().set (response );
@@ -744,7 +751,13 @@ private static class PeerPropertiesFrameHandler extends BaseFrameHandler {
744
751
745
752
@ Override
746
753
int doHandle (Client client , ChannelHandlerContext ctx , ByteBuf message ) {
754
+ LOGGER .debug (
755
+ "Handling peer properties response for connection {}" , client .clientConnectionName ());
747
756
int correlationId = message .readInt ();
757
+ LOGGER .debug (
758
+ "Handling peer properties response for connection {}, correlation ID is {}" ,
759
+ client .clientConnectionName (),
760
+ correlationId );
748
761
int read = 4 ;
749
762
750
763
short responseCode = message .readShort ();
@@ -773,7 +786,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) {
773
786
OutstandingRequest <Map <String , String >> outstandingRequest =
774
787
remove (client .outstandingRequests , correlationId , new ParameterizedTypeReference <>() {});
775
788
if (outstandingRequest == null ) {
776
- LOGGER . warn ( "Could not find outstanding request with correlation ID {}" , correlationId );
789
+ logMissingOutstandingRequest ( correlationId );
777
790
} else {
778
791
outstandingRequest .response ().set (Collections .unmodifiableMap (serverProperties ));
779
792
outstandingRequest .countDown ();
@@ -811,7 +824,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) {
811
824
OutstandingRequest <OpenResponse > outstandingRequest =
812
825
remove (client .outstandingRequests , correlationId , OpenResponse .class );
813
826
if (outstandingRequest == null ) {
814
- LOGGER . warn ( "Could not find outstanding request with correlation ID {}" , correlationId );
827
+ logMissingOutstandingRequest ( correlationId );
815
828
} else {
816
829
outstandingRequest .response ().set (new OpenResponse (responseCode , connectionProperties ));
817
830
outstandingRequest .countDown ();
@@ -900,7 +913,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) {
900
913
OutstandingRequest <SaslAuthenticateResponse > outstandingRequest =
901
914
remove (client .outstandingRequests , correlationId , SaslAuthenticateResponse .class );
902
915
if (outstandingRequest == null ) {
903
- LOGGER . warn ( "Could not find outstanding request with correlation ID {}" , correlationId );
916
+ logMissingOutstandingRequest ( correlationId );
904
917
} else {
905
918
outstandingRequest .response ().set (response );
906
919
outstandingRequest .countDown ();
@@ -943,7 +956,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) {
943
956
correlationId ,
944
957
new ParameterizedTypeReference <List <String >>() {});
945
958
if (outstandingRequest == null ) {
946
- LOGGER . warn ( "Could not find outstanding request with correlation ID {}" , correlationId );
959
+ logMissingOutstandingRequest ( correlationId );
947
960
} else {
948
961
outstandingRequest .response ().set (mechanisms );
949
962
outstandingRequest .countDown ();
@@ -1005,7 +1018,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) {
1005
1018
correlationId ,
1006
1019
new ParameterizedTypeReference <Map <String , StreamMetadata >>() {});
1007
1020
if (outstandingRequest == null ) {
1008
- LOGGER . warn ( "Could not find outstanding request with correlation ID {}" , correlationId );
1021
+ logMissingOutstandingRequest ( correlationId );
1009
1022
} else {
1010
1023
outstandingRequest .response ().set (results );
1011
1024
outstandingRequest .countDown ();
@@ -1026,7 +1039,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) {
1026
1039
OutstandingRequest <Response > outstandingRequest =
1027
1040
remove (client .outstandingRequests , correlationId , Response .class );
1028
1041
if (outstandingRequest == null ) {
1029
- LOGGER . warn ( "Could not find outstanding request with correlation ID {}" , correlationId );
1042
+ logMissingOutstandingRequest ( correlationId );
1030
1043
} else {
1031
1044
Response response = new Response (responseCode );
1032
1045
outstandingRequest .response ().set (response );
@@ -1063,12 +1076,9 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) {
1063
1076
}
1064
1077
1065
1078
OutstandingRequest <List <String >> outstandingRequest =
1066
- remove (
1067
- client .outstandingRequests ,
1068
- correlationId ,
1069
- new ParameterizedTypeReference <List <String >>() {});
1079
+ remove (client .outstandingRequests , correlationId , new ParameterizedTypeReference <>() {});
1070
1080
if (outstandingRequest == null ) {
1071
- LOGGER . warn ( "Could not find outstanding request with correlation ID {}" , correlationId );
1081
+ logMissingOutstandingRequest ( correlationId );
1072
1082
} else {
1073
1083
outstandingRequest .response ().set (streams );
1074
1084
outstandingRequest .countDown ();
@@ -1110,7 +1120,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) {
1110
1120
correlationId ,
1111
1121
new ParameterizedTypeReference <List <String >>() {});
1112
1122
if (outstandingRequest == null ) {
1113
- LOGGER . warn ( "Could not find outstanding request with correlation ID {}" , correlationId );
1123
+ logMissingOutstandingRequest ( correlationId );
1114
1124
} else {
1115
1125
outstandingRequest .response ().set (streams );
1116
1126
outstandingRequest .countDown ();
@@ -1155,7 +1165,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) {
1155
1165
correlationId ,
1156
1166
new ParameterizedTypeReference <List <FrameHandlerInfo >>() {});
1157
1167
if (outstandingRequest == null ) {
1158
- LOGGER . warn ( "Could not find outstanding request with correlation ID {}" , correlationId );
1168
+ logMissingOutstandingRequest ( correlationId );
1159
1169
} else {
1160
1170
outstandingRequest .response ().set (commandVersions );
1161
1171
outstandingRequest .countDown ();
@@ -1189,7 +1199,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) {
1189
1199
OutstandingRequest <StreamStatsResponse > outstandingRequest =
1190
1200
remove (client .outstandingRequests , correlationId , StreamStatsResponse .class );
1191
1201
if (outstandingRequest == null ) {
1192
- LOGGER . warn ( "Could not find outstanding request with correlation ID {}" , correlationId );
1202
+ logMissingOutstandingRequest ( correlationId );
1193
1203
} else {
1194
1204
outstandingRequest .response ().set (new StreamStatsResponse (responseCode , info ));
1195
1205
outstandingRequest .countDown ();
0 commit comments