You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Andrè <mo...@web.de> on 2011/07/08 10:46:30 UTC

whats the difference between these routes??

the first one callled through a proxy, and the second is called directly in
my unitests

like
String response = (String)
inputEndpoint.requestBody("direct:injectRequest",getFileContent("src/main/resources/requests/request.xml"));

the problem is, that sometimes this sAuthZBlocked should block, the first
route (proxy)works, but while testing the second, the bean doesnt block, any
ideas why this is working in route 1 and not in 2? 
is it something with the direct:component ? 


   </route>
       <route>
        <from uri="direct:OtherAuthZWrapper"/>
            <to uri="bean:isAuthZBlocked?method=checkRequest"/>
            <doTry>
                <to uri="bean:OtherAuthZServiceImpl?method=evalRequest"/>
                <doCatch>
                    <exception>org.apache.camel.RuntimeCamelException
					</exception>
                    <process ref="ExceptionDeWrapper"/>
                </doCatch>
            </doTry>
    </route>
    <route>
        <from uri="direct:injectRequest"/>
        <to uri="bean:isAuthZBlocked?method=checkRequest"/>
        <doTry>
            <to
uri="activemq:topic:services.global.xacml.authzRequests?transferException=true"/>
            <doCatch>
                <exception>org.apache.camel.RuntimeCamelException
					</exception>
                <process ref="ExceptionDeWrapper"/>
            </doCatch>
        </doTry>
    </route>

--
View this message in context: http://camel.465427.n5.nabble.com/whats-the-difference-between-these-routes-tp4563945p4563945.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: whats the difference between these routes??

Posted by Andrè <mo...@web.de>.
no it should cause i want that exception be propagated back to the caller, as
a hint, what has been going wrong.

Claus thx for the hint with the filter pattern, the only problem is, when
using it the  bean isAuthZBlocked isnt able to receive meanwhile incoming
messages from another route. 


<route>
        <from uri="direct:injectRequest"/>
        <filter>
         	<method ref="isAuthZBlocked" method="checkDirectInjectedRequest"/>
            <doTry>
                <to
uri="activemq:topic:services.global.xacml.authzRequests?transferException=true"/>
                <doCatch>
                    <exception>org.apache.camel.RuntimeCamelException
					</exception>
                    <process ref="ExceptionDeWrapper"/>
                </doCatch>
            </doTry>
        </filter>
    </route>

--
View this message in context: http://camel.465427.n5.nabble.com/whats-the-difference-between-these-routes-tp4563945p4582764.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: whats the difference between these routes??

Posted by Donald Whytock <dw...@gmail.com>.
Not that familiar with XML-defined routes, but...

If <to uri="bean:isAuthZBlocked?method=checkRequest"/> is supposed to
be generating an Exception that the route responds to, shouldn't it be
inside the <doTry>?

Don

On Fri, Jul 8, 2011 at 1:42 PM, Andrè <mo...@web.de> wrote:
> exactly,
> when i take the filter, will it also allow me to throw an Exception , which
> will be brought to the caller ? (so that it gets a feedback, why it has been
> done)
> thx..
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/whats-the-difference-between-these-routes-tp4563945p4565674.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: whats the difference between these routes??

Posted by Andrè <mo...@web.de>.
exactly,
when i take the filter, will it also allow me to throw an Exception , which
will be brought to the caller ? (so that it gets a feedback, why it has been
done)
thx..

--
View this message in context: http://camel.465427.n5.nabble.com/whats-the-difference-between-these-routes-tp4563945p4565674.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: whats the difference between these routes??

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Jul 8, 2011 at 7:02 PM, Andrè <mo...@web.de> wrote:
> this bean receives information from an other topic and should block the
> incoming message, if the informations are matching this incoming message
> and i thought that would be done through an Exception
>

Do you mean the incoming message should be dropped (when you say block) ?

There is the Message Filter EIP pattern for this kind of use-case
http://camel.apache.org/message-filter




> --
> View this message in context: http://camel.465427.n5.nabble.com/whats-the-difference-between-these-routes-tp4563945p4565526.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: whats the difference between these routes??

Posted by Andrè <mo...@web.de>.
this bean receives information from an other topic and should block the
incoming message, if the informations are matching this incoming message
and i thought that would be done through an Exception

--
View this message in context: http://camel.465427.n5.nabble.com/whats-the-difference-between-these-routes-tp4563945p4565526.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: whats the difference between these routes??

Posted by Andrè <mo...@web.de>.
the bean throws an exception,
that should end further transport

--
View this message in context: http://camel.465427.n5.nabble.com/whats-the-difference-between-these-routes-tp4563945p4565242.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: whats the difference between these routes??

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Jul 8, 2011 at 10:46 AM, Andrè <mo...@web.de> wrote:
> the first one callled through a proxy, and the second is called directly in
> my unitests
>
> like
> String response = (String)
> inputEndpoint.requestBody("direct:injectRequest",getFileContent("src/main/resources/requests/request.xml"));
>
> the problem is, that sometimes this sAuthZBlocked should block, the first
> route (proxy)works, but while testing the second, the bean doesnt block, any
> ideas why this is working in route 1 and not in 2?
> is it something with the direct:component ?
>

What do you mean by "should block" ?


>
>   </route>
>       <route>
>        <from uri="direct:OtherAuthZWrapper"/>
>            <to uri="bean:isAuthZBlocked?method=checkRequest"/>
>            <doTry>
>                <to uri="bean:OtherAuthZServiceImpl?method=evalRequest"/>
>                <doCatch>
>                    <exception>org.apache.camel.RuntimeCamelException
>                                        </exception>
>                    <process ref="ExceptionDeWrapper"/>
>                </doCatch>
>            </doTry>
>    </route>
>    <route>
>        <from uri="direct:injectRequest"/>
>        <to uri="bean:isAuthZBlocked?method=checkRequest"/>
>        <doTry>
>            <to
> uri="activemq:topic:services.global.xacml.authzRequests?transferException=true"/>
>            <doCatch>
>                <exception>org.apache.camel.RuntimeCamelException
>                                        </exception>
>                <process ref="ExceptionDeWrapper"/>
>            </doCatch>
>        </doTry>
>    </route>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/whats-the-difference-between-these-routes-tp4563945p4563945.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/