[HEADS-UP] - CAMEL-885 - ProducerTemplate changes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[HEADS-UP] - CAMEL-885 - ProducerTemplate changes

Claus Ibsen
Hi

CAMEL-885 is definitely a valid issue to be fixed in Camel. However I am afraid that we could break something for end-users. At least we should document in the release notes that if you are using the template (ProducerTemplate aka CamelTemplate) you should be aware that its behavior is changed.

We could postpone it for Camel 2.0, but I think the old behavior is just *WRONG*.

What it does now in the sendBody, requestBody methods (mostly used):
- return IN/OUT if there was an Exception thrown
- return IN/OUT even if there is a FAULT message
- never propagate the exception back (= end-user looses this exception)

I am proposing this change
==========================
- If exchange has exception then throw it (wrapped as RuntimeCamelException as the plain send method does).
- If has FAULT message then return FAULT message
- as before, return either IN/OUT based on exchange pattern

However this breaks quite a few unit tests where we internally had relied on this old "odd" behavior.


I think it's a very important bugfix to get into Camel before a lot more end-users start to use it.


Any thoughts?



Med venlig hilsen

Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

Reply | Threaded
Open this post in threaded view
|

Re: [HEADS-UP] - CAMEL-885 - ProducerTemplate changes

Willem.Jiang
Administrator
+1 for checking the Exeption and FAULT message before return the IN/OUT
message.

Willem
Claus Ibsen wrote:

> Hi
>
> CAMEL-885 is definitely a valid issue to be fixed in Camel. However I am afraid that we could break something for end-users. At least we should document in the release notes that if you are using the template (ProducerTemplate aka CamelTemplate) you should be aware that its behavior is changed.
>
> We could postpone it for Camel 2.0, but I think the old behavior is just *WRONG*.
>
> What it does now in the sendBody, requestBody methods (mostly used):
> - return IN/OUT if there was an Exception thrown
> - return IN/OUT even if there is a FAULT message
> - never propagate the exception back (= end-user looses this exception)
>
> I am proposing this change
> ==========================
> - If exchange has exception then throw it (wrapped as RuntimeCamelException as the plain send method does).
> - If has FAULT message then return FAULT message
> - as before, return either IN/OUT based on exchange pattern
>
> However this breaks quite a few unit tests where we internally had relied on this old "odd" behavior.
>
>
> I think it's a very important bugfix to get into Camel before a lot more end-users start to use it.
>
>
> Any thoughts?
>
>
>
> Med venlig hilsen
>
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
>
>
>