Petals CDK

onExpiredAsyncJBIMessage(Exchange, AsyncContext) - Mauvais exchange passé en parametre

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 5.1.4
  • Fix Version/s: 5.5.0
  • Component/s: runtime
  • Security Level: Public
  • Description:
    Hide

    Sur la méthode onExpiredAsyncJBIMessage(Exchange, AsyncContext), l'exchange recu en paramètre c'est le originalExchange et non pas celui transmis lors du sendAsync.

    Ce qui me parait plus cohérent étant donné que le originalExchange on peut le récupérer à partir de l'AsyncContext et au moins au sait quel Exchange envoyé était en timeout.

    Show
    Sur la méthode onExpiredAsyncJBIMessage(Exchange, AsyncContext), l'exchange recu en paramètre c'est le originalExchange et non pas celui transmis lors du sendAsync. Ce qui me parait plus cohérent étant donné que le originalExchange on peut le récupérer à partir de l'AsyncContext et au moins au sait quel Exchange envoyé était en timeout.
  • Environment:
    windows xp

Activity

Hide
Victor NOËL added a comment - Wed, 27 May 2015 - 15:27:27 +0200

It seems to me that they are both the same exchange: when sending an exchange, it is the one passed as a parameter to the AsyncContext creation.
It makes sense because there was a timeout, so we never got an answer to the sent exchange!

The solution would be to either remove the original exchange from the asynccontext, or not pass the original exchange back in onExpiredAsyncJBIMessage…

The first solution would be more elegant.

Show
Victor NOËL added a comment - Wed, 27 May 2015 - 15:27:27 +0200 It seems to me that they are both the same exchange: when sending an exchange, it is the one passed as a parameter to the AsyncContext creation. It makes sense because there was a timeout, so we never got an answer to the sent exchange! The solution would be to either remove the original exchange from the asynccontext, or not pass the original exchange back in onExpiredAsyncJBIMessage… The first solution would be more elegant.
Hide
Victor NOËL added a comment - Thu, 28 May 2015 - 12:59:15 +0200 - edited

It seems that some component put in the AsyncContext something else than what they send as the original message.
For example the EIP SE, when it forward an exchange and create a new one, stores in the AsyncContext the exchange that was used as a source to the new one…

But I'm pretty sure this field is not meant to be used like that, it makes no sense to put something related to message forwarding in the CDK…

The reason for its existence is that if the exchange succeed (i.e. if we get a response), we have both the original message and the new one. But since they are always the same (because the whole container is implemented so that the object identity of an exchange is preserved… even though it doesn't have to be so according to the JBI spec), then it's useless…
We will keep it like that anyway to be more "JBI compliant" since nothing (theoretically) prevent the answer exchange from being different than the sent one.

It still means that there may be errors in some of the components putting the wrong exchange in the AsyncContext!

Show
Victor NOËL added a comment - Thu, 28 May 2015 - 12:59:15 +0200 - edited It seems that some component put in the AsyncContext something else than what they send as the original message. For example the EIP SE, when it forward an exchange and create a new one, stores in the AsyncContext the exchange that was used as a source to the new one… But I'm pretty sure this field is not meant to be used like that, it makes no sense to put something related to message forwarding in the CDK… The reason for its existence is that if the exchange succeed (i.e. if we get a response), we have both the original message and the new one. But since they are always the same (because the whole container is implemented so that the object identity of an exchange is preserved… even though it doesn't have to be so according to the JBI spec), then it's useless… We will keep it like that anyway to be more "JBI compliant" since nothing (theoretically) prevent the answer exchange from being different than the sent one. It still means that there may be errors in some of the components putting the wrong exchange in the AsyncContext!
Hide
Victor NOËL added a comment - Thu, 28 May 2015 - 13:52:02 +0200

Now the method gets the expired exchange as parameter.

Show
Victor NOËL added a comment - Thu, 28 May 2015 - 13:52:02 +0200 Now the method gets the expired exchange as parameter.
Hide
Victor NOËL added a comment - Tue, 8 Sep 2015 - 17:13:41 +0200

In the end we removed the exchange from the async context: each component should take care of remembering what it needs.

Show
Victor NOËL added a comment - Tue, 8 Sep 2015 - 17:13:41 +0200 In the end we removed the exchange from the async context: each component should take care of remembering what it needs.

People

Dates

  • Created:
    Fri, 21 Dec 2012 - 15:42:12 +0100
    Updated:
    Tue, 8 Sep 2015 - 17:13:41 +0200
    Resolved:
    Thu, 28 May 2015 - 13:52:02 +0200