Hello,

I have a question about the graceful shutdown of the message aggregation. I am 
aggregating up to 10 messages that should be saved to the database and logged 
to the console. When I shut down the application, remaining aggregated data are 
lost.

.aggregate(constant(true), batchInsertAggregationStrategy)
        .completionPredicate(simple("${exchangeProperty.CamelAggregatedSize} >= 
10"))
        .completionTimeout(60000)
        .completeAllOnStop()
.to(dbSaverSqlInsertProcessor.buildSqlBatchInsertEndpoint())
.process(savedIdsLoggingProcessor);

After shutdown the following message is countdowning:

INFO  [org.apache.camel.impl.engine.DefaultShutdownStrategy] (Camel (camel-1) 
thread #23 - ShutdownTask) Waiting as there are still 4 inflight and pending 
exchanges to complete, timeout in 45 seconds. Inflights per route: [route1 = 4]
INFO  [org.apache.camel.impl.engine.DefaultShutdownStrategy] (Camel (camel-1) 
thread #23 - ShutdownTask) Waiting as there are still 4 inflight and pending 
exchanges to complete, timeout in 44 seconds. Inflights per route: [route1 = 4]
...
WARN  [org.apache.camel.impl.engine.DefaultShutdownStrategy] 
(SpringApplicationShutdownHook) Timeout occurred during graceful shutdown. 
Forcing the routes to be shutdown now. Notice: some resources may still be 
running as graceful shutdown did not complete successfully.
WARN  [org.apache.camel.impl.engine.DefaultShutdownStrategy] (Camel (camel-1) 
thread #23 - ShutdownTask) Interrupted while waiting during graceful shutdown, 
will force shutdown now.

Please Can you give me tip what I am doing wrong way? Thank you

Best Regards

Branko Husarik


[cid:image001.png@01DAE3FC.1DF76FF0]
Braňko Husárik
Calypso Developer
IT Development
email: branko.husa...@wood.cz<mailto:branko.husa...@wood.cz>
m: +420 606 022 474

WOOD & Company
Palladium, nám. Republiky 1079/1a
110 00 Prague 1, Czech Republic
wood.com<https://wood.com>







________________________________
DISCLAIMER
WOOD & Company Financial Services, a.s. and its branches are authorized and 
regulated by the CNB as Home State regulator and in Poland by the KNF, in 
Slovakia by the NBS, in Italy by the CONSOB and in the UK by the FCA as Host 
State regulators. For further information about WOOD & Co., its investment 
services, financial instruments and associated risks, safeguard client assets 
(incl. compensation schemes) and contractual relationship please see our 
website at www.wood.com<http://www.wood.com/> under section Corporate 
Governance. Unless otherwise stated, this transmission is neither an offer nor 
the solicitation of an offer to sell or purchase any investment. All estimates, 
opinions and other information contained herein are subject to change without 
notice and are provided in good faith but without legal responsibility or 
liability. Opinion may be personal to the author and may not reflect the 
opinions of WOOD & Co. Communications from sales persons, sales traders or 
traders should not be regarded as investment research and may contain opinions 
or trading ideas which are different from WOOD & Co. investment research 
opinions. This e-mail and any attachments are confidential and may be 
privileged or otherwise protected from disclosure. If you are not a named 
addressee you must not use, disclose, distribute, copy, print or rely on this 
e-mail and any of its attachments. Please notify the sender that you have 
received this email by mistake by replying to the email, and then delete the 
email and any copies of it. Although WOOD & Co. routinely screens e-mails for 
viruses, addressees should scan this e-mail and any attachments for viruses. 
WOOD & Co. makes no representation or warranty as to the absence of viruses in 
this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our clients and business, we may monitor 
and read e-mails sent to and from our server(s).

Reply via email to