|
54 | 54 | * @author Lukasz Kaminski |
55 | 55 | * @author Kyuhyeok Park |
56 | 56 | * @author Wang Zhiyang |
| 57 | + * @author Choi Wang Gyu |
57 | 58 | */ |
58 | 59 | public class ContainerProperties extends ConsumerProperties { |
59 | 60 |
|
@@ -1091,55 +1092,94 @@ public void setRestartAfterAuthExceptions(boolean restartAfterAuthExceptions) { |
1091 | 1092 |
|
1092 | 1093 | @Override |
1093 | 1094 | public String toString() { |
1094 | | - return "ContainerProperties [" |
1095 | | - + renderProperties() |
1096 | | - + "\n ackMode=" + this.ackMode |
1097 | | - + "\n ackCount=" + this.ackCount |
1098 | | - + "\n ackTime=" + this.ackTime |
1099 | | - + "\n consumerStartTimeout=" + this.consumerStartTimeout |
1100 | | - + "\n messageListener=" + this.messageListener |
1101 | | - + (this.listenerTaskExecutor != null |
1102 | | - ? "\n listenerTaskExecutor=" + this.listenerTaskExecutor |
1103 | | - : "") |
1104 | | - + "\n shutdownTimeout=" + this.shutdownTimeout |
1105 | | - + "\n idleEventInterval=" |
1106 | | - + (this.idleEventInterval == null ? "not enabled" : this.idleEventInterval) |
1107 | | - + "\n idlePartitionEventInterval=" |
1108 | | - + (this.idlePartitionEventInterval == null ? "not enabled" : this.idlePartitionEventInterval) |
1109 | | - + (this.transactionManager != null |
1110 | | - ? "\n transactionManager=" + this.transactionManager |
1111 | | - : "") |
1112 | | - + (this.kafkaAwareTransactionManager != null |
1113 | | - ? "\n kafkaAwareTransactionManager=" + this.kafkaAwareTransactionManager |
1114 | | - : "") |
1115 | | - + "\n monitorInterval=" + this.monitorInterval |
1116 | | - + (this.scheduler != null ? "\n scheduler=" + this.scheduler : "") |
1117 | | - + "\n noPollThreshold=" + this.noPollThreshold |
1118 | | - + "\n pauseImmediate=" + this.pauseImmediate |
1119 | | - + "\n pollTimeoutWhilePaused=" + this.pollTimeoutWhilePaused |
1120 | | - + "\n subBatchPerPartition=" + this.subBatchPerPartition |
1121 | | - + "\n assignmentCommitOption=" + this.assignmentCommitOption |
1122 | | - + "\n deliveryAttemptHeader=" + this.deliveryAttemptHeader |
1123 | | - + "\n batchRecoverAfterRollback=" + this.batchRecoverAfterRollback |
1124 | | - + "\n eosMode=" + this.eosMode |
1125 | | - + "\n transactionDefinition=" + this.transactionDefinition |
1126 | | - + "\n stopContainerWhenFenced=" + this.stopContainerWhenFenced |
1127 | | - + "\n stopImmediate=" + this.stopImmediate |
1128 | | - + "\n asyncAcks=" + this.asyncAcks |
1129 | | - + "\n logContainerConfig=" + this.logContainerConfig |
1130 | | - + "\n missingTopicsFatal=" + this.missingTopicsFatal |
1131 | | - + "\n idleBeforeDataMultiplier=" + this.idleBeforeDataMultiplier |
1132 | | - + "\n idleBetweenPolls=" + this.idleBetweenPolls |
1133 | | - + "\n micrometerEnabled=" + this.micrometerEnabled |
1134 | | - + "\n observationEnabled=" + this.observationEnabled |
1135 | | - + (this.observationConvention != null |
1136 | | - ? "\n observationConvention=" + this.observationConvention |
1137 | | - : "") |
1138 | | - + (this.observationRegistry != null |
1139 | | - ? "\n observationRegistry=" + this.observationRegistry |
1140 | | - : "") |
1141 | | - + "\n restartAfterAuthExceptions=" + this.restartAfterAuthExceptions |
1142 | | - + "\n]"; |
| 1095 | + StringBuilder sb = new StringBuilder("ContainerProperties ["); |
| 1096 | + sb.append(renderProperties()); |
| 1097 | + |
| 1098 | + // Core acknowledgment properties |
| 1099 | + appendProperty(sb, "ackMode", this.ackMode); |
| 1100 | + appendProperty(sb, "ackCount", this.ackCount); |
| 1101 | + appendProperty(sb, "ackTime", this.ackTime); |
| 1102 | + |
| 1103 | + // Timeout and startup properties |
| 1104 | + appendProperty(sb, "consumerStartTimeout", this.consumerStartTimeout); |
| 1105 | + appendProperty(sb, "shutdownTimeout", this.shutdownTimeout); |
| 1106 | + |
| 1107 | + // Listener configuration |
| 1108 | + appendProperty(sb, "messageListener", this.messageListener); |
| 1109 | + appendProperty(sb, "listenerTaskExecutor", this.listenerTaskExecutor); |
| 1110 | + |
| 1111 | + // Idle event configuration |
| 1112 | + appendEnabledProperty(sb, "idleEventInterval", this.idleEventInterval); |
| 1113 | + appendEnabledProperty(sb, "idlePartitionEventInterval", this.idlePartitionEventInterval); |
| 1114 | + |
| 1115 | + // Transaction management |
| 1116 | + appendProperty(sb, "transactionManager", this.transactionManager); |
| 1117 | + appendProperty(sb, "kafkaAwareTransactionManager", this.kafkaAwareTransactionManager); |
| 1118 | + appendProperty(sb, "transactionDefinition", this.transactionDefinition); |
| 1119 | + |
| 1120 | + // Monitoring and scheduling |
| 1121 | + appendProperty(sb, "monitorInterval", this.monitorInterval); |
| 1122 | + appendProperty(sb, "scheduler", this.scheduler); |
| 1123 | + appendProperty(sb, "noPollThreshold", this.noPollThreshold); |
| 1124 | + |
| 1125 | + // Container behavior flags |
| 1126 | + appendProperty(sb, "pauseImmediate", this.pauseImmediate); |
| 1127 | + appendProperty(sb, "stopImmediate", this.stopImmediate); |
| 1128 | + appendProperty(sb, "stopContainerWhenFenced", this.stopContainerWhenFenced); |
| 1129 | + appendProperty(sb, "asyncAcks", this.asyncAcks); |
| 1130 | + |
| 1131 | + // Polling and partition configuration |
| 1132 | + appendProperty(sb, "pollTimeoutWhilePaused", this.pollTimeoutWhilePaused); |
| 1133 | + appendProperty(sb, "subBatchPerPartition", this.subBatchPerPartition); |
| 1134 | + appendProperty(sb, "assignmentCommitOption", this.assignmentCommitOption); |
| 1135 | + appendProperty(sb, "idleBetweenPolls", this.idleBetweenPolls); |
| 1136 | + |
| 1137 | + // Header and recovery configuration |
| 1138 | + appendProperty(sb, "deliveryAttemptHeader", this.deliveryAttemptHeader); |
| 1139 | + appendProperty(sb, "batchRecoverAfterRollback", this.batchRecoverAfterRollback); |
| 1140 | + |
| 1141 | + // Exactly-once semantics |
| 1142 | + appendProperty(sb, "eosMode", this.eosMode); |
| 1143 | + |
| 1144 | + // Logging and error handling |
| 1145 | + appendProperty(sb, "logContainerConfig", this.logContainerConfig); |
| 1146 | + appendProperty(sb, "missingTopicsFatal", this.missingTopicsFatal); |
| 1147 | + appendProperty(sb, "restartAfterAuthExceptions", this.restartAfterAuthExceptions); |
| 1148 | + |
| 1149 | + // Metrics and observation |
| 1150 | + appendProperty(sb, "micrometerEnabled", this.micrometerEnabled); |
| 1151 | + appendProperty(sb, "observationEnabled", this.observationEnabled); |
| 1152 | + appendProperty(sb, "observationConvention", this.observationConvention); |
| 1153 | + appendProperty(sb, "observationRegistry", this.observationRegistry); |
| 1154 | + |
| 1155 | + // Data multiplier |
| 1156 | + appendProperty(sb, "idleBeforeDataMultiplier", this.idleBeforeDataMultiplier); |
| 1157 | + |
| 1158 | + sb.append("\n]"); |
| 1159 | + return sb.toString(); |
| 1160 | + } |
| 1161 | + |
| 1162 | + /** |
| 1163 | + * Append a property to the StringBuilder with consistent formatting. |
| 1164 | + * @param sb the StringBuilder |
| 1165 | + * @param name the property name |
| 1166 | + * @param value the property value |
| 1167 | + */ |
| 1168 | + private void appendProperty(StringBuilder sb, String name, @Nullable Object value) { |
| 1169 | + if (value != null) { |
| 1170 | + sb.append("\n ").append(name).append("=").append(value); |
| 1171 | + } |
| 1172 | + } |
| 1173 | + |
| 1174 | + /** |
| 1175 | + * Append a property with "enabled/not enabled" formatting for nullable values. |
| 1176 | + * @param sb the StringBuilder |
| 1177 | + * @param name the property name |
| 1178 | + * @param value the property value (nullable) |
| 1179 | + */ |
| 1180 | + private void appendEnabledProperty(StringBuilder sb, String name, @Nullable Object value) { |
| 1181 | + sb.append("\n ").append(name).append("=") |
| 1182 | + .append(value == null ? "not enabled" : value); |
1143 | 1183 | } |
1144 | 1184 |
|
1145 | 1185 | } |
0 commit comments