address code review comments
This commit is contained in:
parent
f2150dd947
commit
9f4630db06
|
@ -70,3 +70,7 @@ If a Job Definition is set to having Gated Execution, then all work chunks for a
|
||||||
### Job Instance Completion
|
### Job Instance Completion
|
||||||
|
|
||||||
A Batch Job Maintenance Service runs every minute to monitor the status of all Job Instances and the Job Instance is transitioned to either `COMPLETED`, `ERRORED` or `FAILED` according to the status of all outstanding work chunks for that job instance. If the job instance is still `IN_PROGRESS` this maintenance service also estimates the time remaining to complete the job.
|
A Batch Job Maintenance Service runs every minute to monitor the status of all Job Instances and the Job Instance is transitioned to either `COMPLETED`, `ERRORED` or `FAILED` according to the status of all outstanding work chunks for that job instance. If the job instance is still `IN_PROGRESS` this maintenance service also estimates the time remaining to complete the job.
|
||||||
|
|
||||||
|
## Logging
|
||||||
|
|
||||||
|
The job instance ID and work chunk ID are both available through the logback MDC and can be accessed using the `%X` specifier in a `logback.xml` file. See [Logging](/docs/appendix/logging.html#logging) for more details about logging in HAPI.
|
||||||
|
|
|
@ -18,6 +18,7 @@ import jakarta.annotation.Nonnull;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
@ -67,11 +68,9 @@ class WorkChannelMessageHandlerTest extends BaseBatch2Test {
|
||||||
verify(myAppender, atLeastOnce()).doAppend(myLoggingEvent.capture());
|
verify(myAppender, atLeastOnce()).doAppend(myLoggingEvent.capture());
|
||||||
myLoggingEvent.getAllValues()
|
myLoggingEvent.getAllValues()
|
||||||
.forEach(event -> {
|
.forEach(event -> {
|
||||||
Set<String> mdcPropertySetKeys = event.getMDCPropertyMap().keySet();
|
Map<String, String> mdcPropertyMap = event.getMDCPropertyMap();
|
||||||
assertThat(mdcPropertySetKeys).containsExactlyInAnyOrder(BatchJobTracingContext.CHUNK_ID, BatchJobTracingContext.INSTANCE_ID);
|
assertThat(mdcPropertyMap).containsEntry(BatchJobTracingContext.CHUNK_ID, CHUNK_ID);
|
||||||
|
assertThat(mdcPropertyMap).containsEntry(BatchJobTracingContext.INSTANCE_ID, INSTANCE_ID);
|
||||||
Collection<String> mdcPropertySetValues = event.getMDCPropertyMap().values();
|
|
||||||
assertThat(mdcPropertySetValues).containsExactlyInAnyOrder(INSTANCE_ID, CHUNK_ID);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue