camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roman Kalukiewicz" <roman.kalukiew...@gmail.com>
Subject Re: in/out/fault messages discussion
Date Tue, 18 Dec 2007 14:26:19 GMT
basically my idea was something like this:

from("direct:something")
.to("jbi:service:http://some.host/service/name")
.choice()
.when(header("isFault").isNotNull())
.to("xslt:faultTransformation.xsl")
.otherwise()
.to("xslt:successTransformation.xsl")
.end()
.to("mock:result");

In my situation I have to consult some property because I have to know
exact HTTP response code (HTTP endpoint is exposed via JBI), but I
believe there could be some header that marks faults (like this
"isFault").

Then if you want to have current behavior we could have plugable
predicate (at pipeline level) that is evaluated at every step and
breaks pipeline if true. By default it could even check this 'isFault'
header so we are backward compatible.

Anyway my example is currently impossible as pipeline is broken at the
jbi invocation and there is no way (I believe) to transform the
response.

Roman

2007/12/18, Guillaume Nodet <gnodet@gmail.com>:
> Could you give more details on what you'd like to be able to do with the
> DSL, or how you would write it if there was no difference between an Out
> message and a Fault ?
>
> On Dec 18, 2007 2:23 PM, Roman Kalukiewicz <roman.kalukiewicz@gmail.com>
> wrote:
>
> > <cut/>
> >
> > > returning back to HTTP - in camel I have "http.responseCode" header
> > > that works great for me. But in ServiceMix world whenever you have
> > > response code == 500 you have a fault message. In camel it is
> > > extremely easy to handle such response code - in ServiceMix it flows
> > > back and you don't really have a way to catch it somewhere and handle
> > > it properly.
> >
> > I've just faced the problem described above and I'm looking for some
> > solution. So far I failed..
> >
> > I have jbi endpoint that is HTTP and this endpoint returns soap fault
> > message I have to transform using XSLT and then merge back with other
> > responses I could receive. I'm looking for a way to handle this fault
> > response, but the only thing that (I believe) should work is writing
> > my own bean that will send the message and handle fault itself - I
> > cannot find any way to handle it using DSL.
> >
> > BTW this is another point in my in/out/fault discussion as if there
> > are no fault messages that behave in a different way the problem
> > wouldn't exist.
> >
> > Do we have any construct we could use to handle it or is it a thing
> > that just should be created?
> >
> > Thanks,
> > Roman
> >
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
>

Mime
View raw message