Hi Andre,

i know what the problem may be. I had the same.

The solution is: Start activemq :-)

If it is not started then the route hangs and the others will not be started. 
This happens when you use the default constructor of the 
ActiveMqConectionFactory.
It defaults to the failover transport which never times out. 

This problem had me scratching my head me for more than a day...

Christian


-----Ursprüngliche Nachricht-----
Von: Andrè [mailto:morpheusan...@web.de] 
Gesendet: Mittwoch, 15. Juni 2011 10:28
An: users@camel.apache.org
Betreff: what did i forgot? Bean integration through direct:start

i got this class
<code>
public class XacmlRequester {
        
        @Produce(uri = "activemq:topic:xacml.authzRequests")
        ProducerTemplate producer;
        
        @InOnly
        @Consume(uri = "file:src/data/requests?noop=true")
        public void generateRequest(File request){
                System.setProperty("com.sun.xacml.ContextSchema",
"schema/access_control-xacml-2.0-context-schema-os.xsd");
                System.setProperty("com.sun.xacml.PolicySchema",
"schema/access_control-xacml-2.0-policy-schema-os.xsd");
                RequestCtx req;
                try {
                        req = RequestCtx.getInstance(new 
FileInputStream(request));
                        producer.sendBody(req);
                } catch (FileNotFoundException e) {
                        System.out.println("datei nicht gefunden");
                        e.printStackTrace();
                } catch (ParsingException e) {
                        System.out.println("Parserfehler");
                        e.printStackTrace();
                }
                
        }
}
</code>
which i added in the camel-context and in a route this :
 <bean class="de.tarent.abiege.camel.producer.XacmlRequester"
id="xacmlRequest"/>
...
      <route>
        <from uri="direct:start"/>
        <bean method="generateRequest" ref="xacmlRequest">
            <to uri="activemq:topic:xacml.authzRequests"/>
        </bean>
    </route>
      <route>
        <from uri="activemq:topic:xacml.authzRequests"/>
        <log message="request consumed hopefully"/>
        <to uri="file:target/messages/requests"/>
    </route>

So my intention is, consuming an xml Xacml-Request, parsing it and sending it 
but when i let the "camel:run" *g* there is no log message but there is 
something like that
"route6 started and consuming from:
Endpoint[activemq://topic:xacml.authzRequests]"
so where is my request, any idea?


--
View this message in context: 
http://camel.465427.n5.nabble.com/what-did-i-forgot-Bean-integration-through-direct-start-tp4490510p4490510.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to