You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ws07 <ws...@ecs.soton.ac.uk> on 2010/01/19 04:57:29 UTC

Bottleneck problem when send non-persistent async message

Hello,

I have a problem when I submit a huge number of messages to
my consumer class. The queue of my consumer is alway full.
This results in the producer is blocked.

I use Activemq verion 5.1. Non-persistent deliverly is set at producer and I
receive message 
asynchronously by using onMessage(Message message).
My consumer class only receive message and send message to other jms 
client you can see my consumer source code in the file attached.
http://old.nabble.com/file/p27220656/Consumer.java Consumer.java   

Because I'd like to get the best throughput, I try to set 

connectionFactory like this:

	connectionFactory.setAlwaysSessionAsync(true);
	connectionFactory = new ActiveMQConnectionFactory(
                ActiveMQConnection.DEFAULT_USER,
                ActiveMQConnection.DEFAULT_PASSWORD,
                "vm://localhost?async=false");

        connectionFactory.setAlwaysSessionAsync(true);
        connectionFactory.setDispatchAsync(false);


Any ideas to solve this problem?  
-- 
View this message in context: http://old.nabble.com/Bottleneck-problem-when-send-non-persistent-async-message-tp27220656p27220656.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Bottleneck problem when send non-persistent async message

Posted by Gary Tully <ga...@gmail.com>.
On 28 January 2010 19:56, ws07 <ws...@ecs.soton.ac.uk> wrote:

>
> Hi Gary,
>
> Thank you for answering my question.
> Currently, I try to use producer flow control and memory limit as your
> suggestion.
> I've already set producer window size because I use Async Sends and
> non-persistent messages:
>
> connectionFactory.setProducerWindowSize(1048576);
>
> I have a question about producer flow control. It will only be activated
> when the memory limit are reached? So, if the memory limit have not been
> reach, I can continue flood the broker without any control. Do I understand
> this correctly?
>
> That is correct.



> Thanks,
>
> Pete.
>
>
> Gary Tully wrote:
> >
> > Increase the memory given to the jvm and give 60% of that memory to your
> > queue through a memory limit. you are seeing producer flow control in
> > action
> > when the memory limits are reached but for best thought put you should
> try
> > and keep all messages in memory.
> > see: http://activemq.apache.org/producer-flow-control.html and
> > http://activemq.apache.org/my-producer-blocks.html
> >
> > 2010/1/19 ws07 <ws...@ecs.soton.ac.uk>
> >
> >>
> >> Hello,
> >>
> >> I have a problem when I submit a huge number of messages to
> >> my consumer class. The queue of my consumer is alway full.
> >> This results in the producer is blocked.
> >>
> >> I use Activemq verion 5.1. Non-persistent deliverly is set at producer
> >> and
> >> I
> >> receive message
> >> asynchronously by using onMessage(Message message).
> >> My consumer class only receive message and send message to other jms
> >> client you can see my consumer source code in the file attached.
> >> http://old.nabble.com/file/p27220656/Consumer.java Consumer.java
> >>
> >> Because I'd like to get the best throughput, I try to set
> >>
> >> connectionFactory like this:
> >>
> >>        connectionFactory.setAlwaysSessionAsync(true);
> >>        connectionFactory = new ActiveMQConnectionFactory(
> >>                ActiveMQConnection.DEFAULT_USER,
> >>                ActiveMQConnection.DEFAULT_PASSWORD,
> >>                "vm://localhost?async=false");
> >>
> >>        connectionFactory.setAlwaysSessionAsync(true);
> >>        connectionFactory.setDispatchAsync(false);
> >>
> >>
> >> Any ideas to solve this problem?
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/Bottleneck-problem-when-send-non-persistent-async-message-tp27220656p27220656.html
> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > http://blog.garytully.com
> >
> > Open Source Integration
> > http://fusesource.com
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Bottleneck-problem-when-send-non-persistent-async-message-tp27220656p27358785.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: Bottleneck problem when send non-persistent async message

Posted by ws07 <ws...@ecs.soton.ac.uk>.
Hi Gary,

Thank you for answering my question.
Currently, I try to use producer flow control and memory limit as your
suggestion.
I've already set producer window size because I use Async Sends and
non-persistent messages:

connectionFactory.setProducerWindowSize(1048576);

I have a question about producer flow control. It will only be activated
when the memory limit are reached? So, if the memory limit have not been
reach, I can continue flood the broker without any control. Do I understand
this correctly?
 
Thanks,

Pete.


Gary Tully wrote:
> 
> Increase the memory given to the jvm and give 60% of that memory to your
> queue through a memory limit. you are seeing producer flow control in
> action
> when the memory limits are reached but for best thought put you should try
> and keep all messages in memory.
> see: http://activemq.apache.org/producer-flow-control.html and
> http://activemq.apache.org/my-producer-blocks.html
> 
> 2010/1/19 ws07 <ws...@ecs.soton.ac.uk>
> 
>>
>> Hello,
>>
>> I have a problem when I submit a huge number of messages to
>> my consumer class. The queue of my consumer is alway full.
>> This results in the producer is blocked.
>>
>> I use Activemq verion 5.1. Non-persistent deliverly is set at producer
>> and
>> I
>> receive message
>> asynchronously by using onMessage(Message message).
>> My consumer class only receive message and send message to other jms
>> client you can see my consumer source code in the file attached.
>> http://old.nabble.com/file/p27220656/Consumer.java Consumer.java
>>
>> Because I'd like to get the best throughput, I try to set
>>
>> connectionFactory like this:
>>
>>        connectionFactory.setAlwaysSessionAsync(true);
>>        connectionFactory = new ActiveMQConnectionFactory(
>>                ActiveMQConnection.DEFAULT_USER,
>>                ActiveMQConnection.DEFAULT_PASSWORD,
>>                "vm://localhost?async=false");
>>
>>        connectionFactory.setAlwaysSessionAsync(true);
>>        connectionFactory.setDispatchAsync(false);
>>
>>
>> Any ideas to solve this problem?
>> --
>> View this message in context:
>> http://old.nabble.com/Bottleneck-problem-when-send-non-persistent-async-message-tp27220656p27220656.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> http://blog.garytully.com
> 
> Open Source Integration
> http://fusesource.com
> 
> 

-- 
View this message in context: http://old.nabble.com/Bottleneck-problem-when-send-non-persistent-async-message-tp27220656p27358785.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Bottleneck problem when send non-persistent async message

Posted by Gary Tully <ga...@gmail.com>.
Increase the memory given to the jvm and give 60% of that memory to your
queue through a memory limit. you are seeing producer flow control in action
when the memory limits are reached but for best thought put you should try
and keep all messages in memory.
see: http://activemq.apache.org/producer-flow-control.html and
http://activemq.apache.org/my-producer-blocks.html

2010/1/19 ws07 <ws...@ecs.soton.ac.uk>

>
> Hello,
>
> I have a problem when I submit a huge number of messages to
> my consumer class. The queue of my consumer is alway full.
> This results in the producer is blocked.
>
> I use Activemq verion 5.1. Non-persistent deliverly is set at producer and
> I
> receive message
> asynchronously by using onMessage(Message message).
> My consumer class only receive message and send message to other jms
> client you can see my consumer source code in the file attached.
> http://old.nabble.com/file/p27220656/Consumer.java Consumer.java
>
> Because I'd like to get the best throughput, I try to set
>
> connectionFactory like this:
>
>        connectionFactory.setAlwaysSessionAsync(true);
>        connectionFactory = new ActiveMQConnectionFactory(
>                ActiveMQConnection.DEFAULT_USER,
>                ActiveMQConnection.DEFAULT_PASSWORD,
>                "vm://localhost?async=false");
>
>        connectionFactory.setAlwaysSessionAsync(true);
>        connectionFactory.setDispatchAsync(false);
>
>
> Any ideas to solve this problem?
> --
> View this message in context:
> http://old.nabble.com/Bottleneck-problem-when-send-non-persistent-async-message-tp27220656p27220656.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com