Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8063305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:59:14+00:00 2026-06-05T10:59:14+00:00

I would like to access all the Synchronization’s that were added to an exchange

  • 0

I would like to access all the Synchronization’s that were added to an exchange during a camel route.

The reason for this is that when a particular type of exception happens, I want to route the message to an error handling component and let that error handling component execute the “onCompletion” of those synchronizations even though there was an exception.

the synchronizations are added by using

exchange.getUnitofWork().addSynchronization(new MySyncAdapter());

and I was trying to access them with

exchange.handoverCompletions();

However, I think I must be doing something wrong because no matter which component I try to get the completions from (my real component, or the error component), the list is null.

Edit:

According tot he answer below, this should work:

exchange.addOnCompletion(new MySyncAdapter());
List<Synchronization> syncs = exchange.handoverCompletions();

however, syncs is still null. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:59:16+00:00Added an answer on June 5, 2026 at 10:59 am

    The Exchange in this case does not have the Completions/Synchronizations, the UnitOfWork instance does so when you call exchange.handoverCompletions() you will get a null. You also do not have access to the synchronizations in the UnitOfWork because it is being handled in a different thread. Any attempt to modify them, which is what handoverCompletion does, causes a concurrency exception.

    In reality you are trying to use something in a way it wasn’t intended. Exchange errors should be handled by invoking the Exception Clause DSL outlined here. It is designed to capture exchange errors in a fine grained manner by allowing a developer to define the Exception type and forward the Exchange to a route for further processing by your error handling component.

    Best Regards,
    Scott ES

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to develop a mobile application that is able to access all
I would like to be able to access all the components of say a
I have a web folder that I would like to restrict access to via
My company would like to have access to all of their google adwords data
I would like to be able to get access to all trusted root certificates
I would like access all tables iterating in a web page with unknown numbers
I have the dictionary below and I would like to get access to all
I would like to access skyDrive using PHP. I want to retreive list of
I would like to access a MySQL database using PHP. Can someone please explain
I would like to access class variables with for loop, here is my simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.