I have found a problem regarding a wiretap and the camel-jpa component. I have a route with an async split through a wiretap. In each route, I use a jpa producer to persist an entity. The problem is, that the entitymanager was closed before the async routes can reach the end. The cause is, that the same entitymanager is used in the async routes. The main route reaches the end and closes the entitymanager.
E.g. like the following route:
I think a possible fix can be to check that the entitymanager is null or closed. If null or closed, create a new entitymanager.
Another solution can be in the wiretap. There where the exchange is copied, the "CamelEntityManager" property could be removed.
Currently, my quickfix is: At the beginning of the async route I remove the entitymanager from the exchange.