camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiangqiuzhao <xiangqiuz...@gmail.com>
Subject No consumers available on endpoint exception?
Date Thu, 15 Dec 2011 07:11:03 GMT
        MQQueueConnectionFactory cf = new MQQueueConnectionFactory(); 
        JmsConfiguration jc = new JmsConfiguration(cf); 
        
        cf.setHostName("172.16.16.136"); 
        cf.setPort(1416); 
        cf.setQueueManager("QM2"); 
        cf.setChannel("BTOA"); 
        cf.setTransportType(1);
                
        JmsComponent ibmmq = new JmsComponent(jc); 
        ibmmq.setAcknowledgementModeName("AUTO_ACKNOWLEDGE");         
        
        CamelContext camel = new DefaultCamelContext();         
        camel.addComponent("ibmmq", ibmmq); 
                
        camel.addRoutes(new RouteBuilder() { 
            public void configure() { 
                from("direct:test").to("ibmmq:QRB");
            } 
        }); 
        
        Endpoint endpoint = camel.getEndpoint("direct:test");
        Exchange exchange = endpoint.createExchange();
        String data = "send something";
        Producer producer = endpoint.createProducer();
        exchange.getIn().setBody(data);
        producer.process(exchange);
        System.out.println(new String((byte[])exchange.getOut().getBody()));


Exception in thread "main" org.apache.camel.CamelExchangeException: No
consumers available on endpoint: Endpoint[direct://test]. Exchange[Message:
send something]
	at
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:46)
	at com.sunyard.camel.TestJmsComponent.main(TestJmsComponent.java:51)


where is wrong in my program?

--
View this message in context: http://camel.465427.n5.nabble.com/No-consumers-available-on-endpoint-exception-tp5076708p5076708.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message