You need to start the CamelContext before you send a message to it.
Invoke .start() on the camel instance.


On Thu, Dec 15, 2011 at 8:11 AM, xiangqiuzhao <xiangqiuz...@gmail.com> wrote:
>        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.



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

Reply via email to