camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: No consumers available on endpoint exception?
Date Thu, 15 Dec 2011 07:18:34 GMT
This also hit me some times before. Perhaps we can improve the error 
message.

Christian

Am 15.12.2011 08:14, schrieb Claus Ibsen:
> 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<xiangqiuzhao@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.
>
>


-- 

Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Mime
View raw message