/** * Set a message channel to which an * {@link org.springframework.messaging.support.ErrorMessage} will be sent if sending the * released message fails. If the error flow returns normally, the release is complete. * If the error flow throws an exception, the release will be re-attempted. * If there is a transaction advice on the release task, the error flow is called * within the transaction. * @param channel the channel. * @return the endpoint spec. * @see #maxAttempts(int) * @see #retryDelay(long) * @since 5.0.8 */ public DelayerEndpointSpec delayedMessageErrorChannel(MessageChannel channel) { this.handler.setDelayedMessageErrorChannel(channel); return this; }
final CountDownLatch latch = new CountDownLatch(1); final AtomicInteger count = new AtomicInteger(); delayHandler.setDelayedMessageErrorChannel((m, t) -> { count.incrementAndGet(); int deliveries = StaticMessageHeaderAccessor.getDeliveryAttempt(m).get();
/** * Set a message channel to which an * {@link org.springframework.messaging.support.ErrorMessage} will be sent if sending the * released message fails. If the error flow returns normally, the release is complete. * If the error flow throws an exception, the release will be re-attempted. * If there is a transaction advice on the release task, the error flow is called * within the transaction. * @param channel the channel. * @return the endpoint spec. * @see #maxAttempts(int) * @see #retryDelay(long) * @since 5.0.8 */ public DelayerEndpointSpec delayedMessageErrorChannel(MessageChannel channel) { this.handler.setDelayedMessageErrorChannel(channel); return this; }