Hi

Please use the @user mailing list / user forum for these kind of
questions / help with Camel.
http://camel.apache.org/mailing-lists.html

On Sun, Dec 15, 2013 at 10:22 AM, RJILI Youssef <rjiliyous...@gmail.com> wrote:
> Hello,
> I'm new in apache camel and i have a problem about the JDBC connection and
> the filling of activemq.
> My activemq lunched.
> My code :
> *        private void fillActiveMq() throws Exception{*
> * JndiRegistry registry = new JndiRegistry(new JndiContext());*
> * CamelContext camelCtxt = new DefaultCamelContext(registry);*
> * MysqlDataSource datasource = getDataSource();*
> * JdbcEndpoint endpoint = getJDBCEndPoint(datasource, camelCtxt);*
>
> * registry.bind("bulksms", datasource);*
> * ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(*
>
> * "admin", "admin", ActiveMQConnection.DEFAULT_BROKER_URL);*
>
> *
> //camelCtxt.addComponent("activemq",ActiveMQComponent.activeMQComponent("vm://localhost?broker.persistent=false"));*
> * camelCtxt.addComponent("activemq",
> JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));*
> * camelCtxt.addEndpoint("direct:start", endpoint);*
>
> * camelCtxt.addRoutes(new RouteBuilder() {*
>
> * @Override*
> * public void configure() throws Exception {*
> * from("direct:start").setBody(constant("select * from
> message")).to("activemq:queue.foo");*
> * }*
> * });*
> * camelCtxt.start();*
> * Thread.sleep(1000);*
>
> * camelCtxt.stop();*
> * }*
> * private  MysqlDataSource getDataSource() {*
> * MysqlDataSource datasource = new MysqlDataSource();*
> * datasource.setUser("root");*
> * datasource.setPassword("root");*
> * datasource.setDatabaseName("bulksms");*
> * datasource.setPortNumber(3306);*
> * datasource.setServerName("127.0.0.1");*
> * return datasource;*
> * }*
>
> * private  JdbcEndpoint getJDBCEndPoint(MysqlDataSource datasource,*
> * CamelContext camelCtxt) {*
>
> * JdbcEndpoint endpoint = new JdbcEndpoint();*
> * endpoint.setDataSource(datasource);*
> * endpoint.setCamelContext(camelCtxt);*
> * return endpoint;*
> * }*
>
> *I have this exception :*
>
>
> *Exception in thread "main" java.lang.UnsupportedOperationException: Not
> supported at
> org.apache.camel.component.jdbc.JdbcEndpoint.createConsumer(JdbcEndpoint.java:59)
> at
> org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:65)
> at
> org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:80)
> at org.apache.camel.impl.RouteService.warmUp(RouteService.java:134) at
> org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:2109)
> at
> org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:2039)
> at
> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1827)
> at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1699)
> at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1544)
> at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1512)
> at
> com.apachecamel.ManageQueueFromDB.fillActiveMq(ManageQueueFromDB.java:83)
> at com.apachecamel.ManageQueueFromDB.main(ManageQueueFromDB.java:54)Any
> help please.Best regards*
>
> *RJILI Youssef*
> *Développeur JAVA*
> *Orange labs Tunisia / Equipe Soft Promise *
> *tél : +216 31 300 712 *
> mob : +216 23 077 642



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Reply via email to