i implemented an Proxy, which send the requests to an other activemq
instance,which answers the request:
(the broker are started with the peer protocol) 
(Broker A)
        <proxy id="Xacml_AuthZ_Service"
                
serviceInterface="de.tarent.abiege.xacmlAuthZServiceWraper.XacmlAuthzService"
                        serviceUrl="direct:AuthzService" />

                <route>
                        <from uri="direct:AuthzService" />
                        <to 
uri="activemq:queue:services.global.xacml.authzRequests" />
                </route>
(Broker B)
                <route id="jboss_SunXacml_PDP_reveices_Request_Route">
                        <from 
uri="activemq:queue:services.global.xacml.authzRequests" />
                        <log message=" Xacml request consumed" />
                        <to uri="bean:pdp" />
                </route>

in an unit test, i´m doing this
        @Test
        public void testAuthzServiceException() throws Exception {
                boolean catched = false;
                try {
                        XacmlAuthzService authzService =
context.getRegistry().lookup("Xacml_AuthZ_Service",XacmlAuthzService.class);
                        String response =
authzService.evalAuthzRequest(expectedBodies[0].toString());
//                      assertMockEndpointsSatisfied(5000, 
TimeUnit.MILLISECONDS);
                        System.out.println(response);
                        
                } catch (ParsingException e) {
                        System.out.println(" Parsing catched");
                        catched = true;
                } catch (Exception e) {
                        System.out.println("something catched");
                        e.printStackTrace();
                }
                assert(catched);
        }

so i just want to test whether the exception is the  thrown one, like it is
written in Camel in Action, page 126 (default: no redelivery/propagated back
to caller)
 something catched
25723 [Camel (camel-3) thread #2 -
JmsReplyManagerTimeoutChecker[services.global.xacml.authzRequests]] ERROR
org.apache.camel.processor.DefaultErrorHandler - Failed delivery for
exchangeId: ID-student02-bonn-tarent-de-57172-1308667766469-1-3. Exhausted
after delivery attempt: 1 caught:
org.apache.camel.ExchangeTimedOutException: The OUT message was not received
within: 20000 millis. Exchange[Message: BeanInvocation public abstract
java.lang.String
de.tarent.abiege.xacmlAuthZServiceWraper.XacmlAuthzService.evalAuthzRequest(java.lang.String)
throws org.jboss.security.xacml.sunxacml.ParsingException with [<something
id='1'>expectedBody1</something>]]]
org.apache.camel.ExchangeTimedOutException: The OUT message was not received
within: 20000 millis. Exchange[Message: BeanInvocation public abstract
java.lang.String
de.tarent.abiege.xacmlAuthZServiceWraper.XacmlAuthzService.evalAuthzRequest(java.lang.String)
throws org.jboss.security.xacml.sunxacml.ParsingException with [<something
id='1'>expectedBody1</something>]]]
        at
org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:121)
        at
org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onTimeout(TemporaryQueueReplyHandler.java:59)
        at
org.apache.camel.component.jms.reply.CorrelationMap.onEviction(CorrelationMap.java:34)
        at
org.apache.camel.component.jms.reply.CorrelationMap.onEviction(CorrelationMap.java:26)
        at
org.apache.camel.util.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:206)
        at
org.apache.camel.util.DefaultTimeoutMap.run(DefaultTimeoutMap.java:158)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:636)
java.lang.reflect.UndeclaredThrowableException
        at $Proxy35.evalAuthzRequest(Unknown Source)
        at
de.tarent.abiege.XacmlAuthzServiceWrapper.test.CamelContextXmlTest.testAuthzServiceException(CamelContextXmlTest.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at
org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
        at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
        at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
        at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
        at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
        at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
        at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: org.apache.camel.ExchangeTimedOutException: The OUT message was
not received within: 20000 millis. Exchange[Message: BeanInvocation public
abstract java.lang.String
de.tarent.abiege.xacmlAuthZServiceWraper.XacmlAuthzService.evalAuthzRequest(java.lang.String)
throws org.jboss.security.xacml.sunxacml.ParsingException with [<something
id='1'>expectedBody1</something>]]]
        at
org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:121)
        at
org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onTimeout(TemporaryQueueReplyHandler.java:59)
        at
org.apache.camel.component.jms.reply.CorrelationMap.onEviction(CorrelationMap.java:34)
        at
org.apache.camel.component.jms.reply.CorrelationMap.onEviction(CorrelationMap.java:26)
        at
org.apache.camel.util.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:206)
        at
org.apache.camel.util.DefaultTimeoutMap.run(DefaultTimeoutMap.java:158)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:636)
25723 [main] INFO
de.tarent.abiege.XacmlAuthzServiceWrapper.test.CamelContextXmlTest - Testing
done

so as we can see, i  get this ExchangeTimeout, but why didn´t i catch my
ParsingException ?
and why is it waiting for an out message? (and how do i set it ?)


--
View this message in context: 
http://camel.465427.n5.nabble.com/Errorhandling-Question-ExchangeTimeOutException-tp4510884p4510884.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to