Dhairya-007 opened a new pull request, #29543:
URL: https://github.com/apache/camel/pull/29543
`DoclingProducer.checkConversionStatus` exposes the fields of the
`ConversionStatus` it returns as headers "for easy access":
```java
exchange.getIn().setHeader(DoclingHeaders.TASK_ID, status.getTaskId());
exchange.getIn().setHeader("CamelDoclingTaskStatus",
status.getStatus().toString());
...
exchange.getIn().setHeader("CamelDoclingTaskProgress", status.getProgress());
...
exchange.getIn().setHeader("CamelDoclingResult", status.getResult());
...
exchange.getIn().setHeader("CamelDoclingErrorMessage",
status.getErrorMessage());
```
Only the first one goes through `DoclingHeaders`. The other four are string
literals, so they have no constant to reference from a route, no `@Metadata`,
and they are absent from `docling.json` and from the *Message Headers* table of
the component page, which lists the 32 declared headers and none of these.
This PR declares them in `DoclingHeaders` (`TASK_STATUS`, `TASK_PROGRESS`,
`TASK_RESULT`, `TASK_ERROR_MESSAGE`, keeping the existing header names so
nothing changes at runtime), uses the constants in the producer, and adds the
four entries to the component and `camel-catalog` JSON (indexes 32–35, after
the last declared header, which is where the generator appends them; the two
files stay byte-identical).
Tests: `DoclingAsyncConversionTest` now also asserts the headers on a
completed local task (`CamelDoclingTaskStatus=COMPLETED`, `CamelDoclingResult`
equal to the status result, no error message) and on an in-progress one
(`IN_PROGRESS`, no result).
--
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]