You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by lleclerc <ll...@aim-rg.com> on 2012/12/04 17:21:59 UTC

Dynamic endpoint using Recipient, ExchangeTimedOutException

Hi,

I got 2 separate projects, the project1 is an osgi component that start a
CamelContext with routes and use a dynamic recipientList(). On project2, I
call addRecipient(Endpoint endpoint) from project1's exported service.

In project1, my route is like this :
                from(sedaEndPointURI).delay(delayedData)
                        .process(new Processor() {
                            @Override
                            public void process(Exchange exchange) throws
Exception {
                                exchange.getOut().setBody("MYTEST");
                            }
                        })
                .recipientList(method(recipientListHolder,
RECIPIENT_METHOD_NAME));

And recipientList is like this :
    @RecipientList
    public Endpoint[] getRecipientList() {
        return recipientList.toArray(new Endpoint[0]);
    }

In project2, I am doing something like this : 
SedaEndpoint sedaEndpoint = new SedaEndpoint(sedaEndpointURI, new
SedaComponent(), new LinkedBlockingQueue<Exchange>());

sedaEndpoint.createConsumer(new Processor() {
            @Override
            public void process(Exchange exchange) throws Exception {
                System.out.println("Receiving stream2");
            }
        });

project1.addRecipient(sedaEndpoint);

I must be missing something here because I am getting this error :

2012-12-04 10:25:40,434 WARN  [SedaConsumer] Error processing exchange. 
Exchange[Message: MYTEST]. Caused by:
[org.apache.camel.ExchangeTimedOutException - 
The OUT message was not received within: 30000 millis. 
Exchange[Message: MYTEST]] org.apache.camel.ExchangeTimedOutException: 
The OUT message was not received within: 30000 millis. Exchange[Message:
MYTEST]

I tried recipient.setCamelContext(this); inside the addRecipientMethod on
project1 side without success..

What settings am I missing and how can I consume the messages from the
endpoint without affecting the route, only using the endpoint ? 

Thanks,




--
View this message in context: http://camel.465427.n5.nabble.com/Dynamic-endpoint-using-Recipient-ExchangeTimedOutException-tp5723624.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Process message on Endpoint using recipientList.

Posted by lleclerc <ll...@aim-rg.com>.
Thanks!

What is the nabble link ?

I was missing the start().
I got another problem but I could fix it. 

It was a NullPointerException, caused by not setting the CamelContext of my
Endpoint.
I used the debugger and found it in SedaConsumer.setupTasks() on
getCamelContext().

Thanks again !



--
View this message in context: http://camel.465427.n5.nabble.com/Process-message-on-Endpoint-using-recipientList-tp5723624p5723707.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Process message on Endpoint using recipientList.

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Need to see the nabble link for the mail.

No its not illegal. The police will not come and arrest you :)

You would need to start the consumer if it should consume messages
from the seda queue.
Though people often uses a route to define that, instead of the more
verbose java code.



On Wed, Dec 5, 2012 at 9:17 PM, lleclerc <ll...@aim-rg.com> wrote:
> *edited this post to be more simple.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Process-message-on-Endpoint-using-recipientList-tp5723624p5723671.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Process message on Endpoint using recipientList.

Posted by lleclerc <ll...@aim-rg.com>.
*edited this post to be more simple.



--
View this message in context: http://camel.465427.n5.nabble.com/Process-message-on-Endpoint-using-recipientList-tp5723624p5723671.html
Sent from the Camel - Users mailing list archive at Nabble.com.