allthingssecurity commented on PR #30625:
URL: https://github.com/apache/camel/pull/30625#issuecomment-7094479094
Thanks for the review. All three are in 7448134921.
1. Exception type. Agreed, the stopped case now throws
`RejectedExecutionException`, the same as a request that reaches the stopped
reply manager when it registers (CAMEL-27321) and as #30630, so
`onException(RejectedExecutionException.class)` sees one type for that stop.
The timeout case now completes the exchange with `ExchangeTimedOutException`
(timeout = the endpoint `requestTimeout`), with a message that says the request
was not sent. As that exception is checked and `getReplyTo()` declares none,
the reply manager throws it wrapped in a `RuntimeCamelException`, and
`SjmsProducer` sets the cause on the exchange, so `exchange.getException()` is
the `ExchangeTimedOutException` itself. Its `getExchange()` is null, as
`getReplyTo()` has no exchange. Tests:
`testStopReleasesRequestWaitingForNewTemporaryQueue` asserts
`RejectedExecutionException`,
`testRequestFailsWhenNoNewTemporaryQueueWithinRequestTimeout` asserts
`ExchangeTimedOutException` with timeout 1000 and "not sent" in the
message.
2. Test margin. Done as you suggested: the control test uses
`requestTimeout=20000` on the endpoint and `CamelJmsRequestTimeout=500` on the
exchange. I checked that the header path applies: `SjmsProducer.processInOut`
reads the header and passes it to `registerReply`, and the test now asserts
`getTimeout() == 500` on the `ExchangeTimedOutException`, so the wait used the
20 s and the registered request the 500 ms. Test:
`testRequestIsSentWhenTheRecoveryCreatesTheNewTemporaryQueue`.
3. `<tt>` replaced with `{@code ...}`.
Tests: on the first commit the stop and timeout tests now fail (they get
`IllegalStateException`); with the change the class 20 times in one JVM: 60
run, 0 failures, and the camel-sjms unit tests: 234 run, 0 failures, 5 skipped.
--
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]