You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ricardofaccioli <ri...@vpidata.com> on 2012/01/19 13:41:12 UTC

Sending a ArrayList takes so long ?
Hello,

When I send one ArrayList<Objects> with a size about 150  in :

exchange.getOut().setBody();

My app(client) stuck and  don`t receive the message:

        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();
        List<ResourceProperties> response = new
ArrayList<ResourceProperties>();
        response = (List<ResourceProperties>) exchange.getOut().getBody();


if I send only one object I receive without a problem.


Tks


--
View this message in context: http://camel.465427.n5.nabble.com/Sending-a-ArrayList-Object-takes-so-long-tp5157568p5157568.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Sending a ArrayList takes so long ? Posted by ricardofaccioli <ri...@vpidata.com>.
Babak,

Yes my broker have a active mq:


from("activemq:analisarColeta1:analisarColeta").to("seda:analisarColeta?concurrentConsumers="
+ execucoesSimultaneas);


I finally fix the problem!
The class ResourceProperties in client side, I forgot the implements
Serializable. =[
When I done this the problem gone.
Tks for your attention.


--
View this message in context: http://camel.465427.n5.nabble.com/Sending-a-ArrayList-Object-takes-so-long-tp5157568p5157802.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Sending a ArrayList takes so long ? Posted by Babak Vahdat <ba...@swissonline.ch>.
Hi,

somehow I still don't get it!

Your routing logic does consume using the Seda endpoint however your client
logic where you produce and send an exchange uses the ActiveMQ component
[1]! So that I can't correlate these two code snippets to each other.

Another question: the Executor you make use of by the process method of your
anonymous Processor implementation: Does it's analisarColeta() method
work/return synchronously?

[1] http://camel.apache.org/activemq.html

Babak

--
View this message in context: http://camel.465427.n5.nabble.com/Sending-a-ArrayList-Object-takes-so-long-tp5157568p5157782.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Sending a ArrayList takes so long ? Posted by ricardofaccioli <ri...@vpidata.com>.
Hello:

My Broker receive a message and generate a list of Objects:

 from("seda:analisarColeta?concurrentConsumers=" +
execucoesSimultaneas).process(new Processor() {
            public void process(Exchange exchange) throws Exception {
                AnalisarColetaReq req = (AnalisarColetaReq)
exchange.getIn().getBody();
                Executer exec = new Executer();
                exchange.getOut().setBody(exec.analisarColeta(req));
            }
        });


The problem is my client:



        Endpoint endpoint =
com.vpidata.ibope.broker.stuffs.CamelStart.camelContext.getEndpoint("activemq:analisarColeta"
+ campanha.servidor.id + ":analisarColeta");
        Exchange exchange = endpoint.createExchange(ExchangePattern.InOut);
        exchange.getIn().setBody(req);
        Producer producer = endpoint.createProducer();
        producer.start();

     // In this part my app stuck, Broker receive the message, process but I
can't get de out.
        producer.process(exchange);
        producer.stop();
        List<ResourceProperties> response = new
ArrayList<ResourceProperties>();
        response = (List<ResourceProperties>) exchange.getOut().getBody();

I think this happens because it`s a heavy array list sended 

--
View this message in context: http://camel.465427.n5.nabble.com/Sending-a-ArrayList-Object-takes-so-long-tp5157568p5157612.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Sending a ArrayList takes so long ? Posted by Babak Vahdat <ba...@swissonline.ch>.
Hi,

Could you be please more precise about the problem you're facing? Is the
line:

exchange.getOut().setBody(); 

part of your *own* implemented Producer logic? If not which Camel component
do you make use of?

And along the 2 lines:

List<ResourceProperties> response = new ArrayList<ResourceProperties>();
response = (List<ResourceProperties>) exchange.getOut().getBody();

Why do you assign the response reference to an ArrayList object if you
assign it right afterwards on the second line to be the Body content of the
Out Message?

Babak

--
View this message in context: http://camel.465427.n5.nabble.com/Sending-a-ArrayList-Object-takes-so-long-tp5157568p5157593.html
Sent from the Camel - Users mailing list archive at Nabble.com.