You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by dhoni2008 <go...@rediffmail.com> on 2008/10/14 11:18:38 UTC

Re: Reg : Servicemix transactions and component thread pool

Hi, 

we have done a poc as mentioned in this post and we expect all the requests
to be wait in the  queue.
But, the result that we got is a different.   Scneario that we tested is as
follows:

http - CBR - bean.

In the bean component, we are introducing some delay with Tread.sleep(10000)
during processing. Also we are logging message "Received Exchange"  after 
bean component receives the exchange and "Sending Exchange".

if we sent 10 parallel requests from the http endpoint, the outcome should
be

Received exchange
Sending exchange
Received Exchange
SendingExchange
....

But the response that we got is, 
Received exchange
Received exchange
Received exchange
.....
Sending exchange
Sending exchange
Sending exchange
Sending exchange
Sending exchange

....

This means no request are being waiting in the queue.   

Our thread pool configuration is as follows:

servicemix.corePoolSize    = 1
servicemix.maximumPoolSize = 1
servicemix.queueSize       = 0

Regards
Dhoni 2008.




gnodet wrote:
> 
> Yes, everything is correct.
> 
> Wrt transactions, the http component is currently not able to start a
> transaction (mainly because http is not a transactional protocol), so
> in order to have your process transacted, I would suggest the use of
> two JMS endpoints between http and the CBR.  The first JMS endpoint
> (provider) would not be transacted, but the second one would be.
> 
> On Fri, Sep 26, 2008 at 8:01 AM, sachin2008 <es...@gmail.com> wrote:
>>
>> Hi ,
>>
>> I have some query on the servicemix transactions.
>>
>> Im my code exchange.isTransacted() is returnning false in the components
>> like eip, drools and other components.
>>
>> When I look into the CBR code, I found that  if exchange.isTransacted()
>> returns false, then EIPEndpoint invoked processAsync of CBR. This inturn
>> calls the other components using send() i.e using asynchronous
>> communication.
>>
>> Is my assumtioon of CBR uses async communication is correct or not?
>>
>> if this is correct, assume the follwing scenario.
>>
>> http -> CBR -> bean.
>>
>> In the above scenario CBR invokes bean using async(). But, in case of
>> async
>> processing, component threads comes into picture.  For example, if I set
>> the
>> corePoolThreadSize and MaximumPoolSize all as 1 for the bean component,
>> only
>> 1 request will be processed by the bean at a time.  Then in this case,
>> all
>> the requests to the bean component needs to  wait in the  queue.
>>
>> Is this correct ?
>>
>> Please clarify this as this ASAp as it is very important to us.
>>
>>
>> -----
>> Cheers
>> Praveen Oruganti
>> "Think before you act and act on what you believe"
>> --
>> View this message in context:
>> http://www.nabble.com/Reg-%3A-Servicemix-transactions-and-component-thread-pool-tp19682972p19682972.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Reg-%3A-Servicemix-transactions-and-component-thread-pool-tp19682972p19969785.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Reg : Servicemix transactions and component thread pool

Posted by Guillaume Nodet <gn...@gmail.com>.
You're right.  If the exchange is not transacted, the EIP will execute
asynchronously.
So setting the thread pool size to 1 will not ensure that the first
exchange is fully terminated before another one is processed.  It will
only ensure that one exchange is processed at the same time (but as
there are several steps in fully completing the requests, steps will
be interleaved).

On Tue, Oct 14, 2008 at 12:11 PM, dhoni2008
<go...@rediffmail.com> wrote:
>
> Yes my exchanges are not being transacted as i am using http and the
> transactions inititated by http never get transacted.
>
> But my doubt is , exchanges are not transacted so, eip calls bean using
> send(). And this request  will be executed by the bean component
> immediately. But, the remaing requests needs to be waited for the first
> request to be complete.
>
> And my doubt is why this is not happening. as the eip is calling  bean using
> in an asynchronous fashion, why more than one request is being processed
> simultaneously.
>
> Regards
> Gopi Krishna
>
>
> gnodet wrote:
>>
>> This may be because your exchanges are not really transacted.  What's
>> the configuration you used ?
>>
>> On Tue, Oct 14, 2008 at 11:18 AM, dhoni2008
>> <go...@rediffmail.com> wrote:
>>>
>>> Hi,
>>>
>>> we have done a poc as mentioned in this post and we expect all the
>>> requests
>>> to be wait in the  queue.
>>> But, the result that we got is a different.   Scneario that we tested is
>>> as
>>> follows:
>>>
>>> http - CBR - bean.
>>>
>>> In the bean component, we are introducing some delay with
>>> Tread.sleep(10000)
>>> during processing. Also we are logging message "Received Exchange"  after
>>> bean component receives the exchange and "Sending Exchange".
>>>
>>> if we sent 10 parallel requests from the http endpoint, the outcome
>>> should
>>> be
>>>
>>> Received exchange
>>> Sending exchange
>>> Received Exchange
>>> SendingExchange
>>> ....
>>>
>>> But the response that we got is,
>>> Received exchange
>>> Received exchange
>>> Received exchange
>>> .....
>>> Sending exchange
>>> Sending exchange
>>> Sending exchange
>>> Sending exchange
>>> Sending exchange
>>>
>>> ....
>>>
>>> This means no request are being waiting in the queue.
>>>
>>> Our thread pool configuration is as follows:
>>>
>>> servicemix.corePoolSize    = 1
>>> servicemix.maximumPoolSize = 1
>>> servicemix.queueSize       = 0
>>>
>>> Regards
>>> Dhoni 2008.
>>>
>>>
>>>
>>>
>>> gnodet wrote:
>>>>
>>>> Yes, everything is correct.
>>>>
>>>> Wrt transactions, the http component is currently not able to start a
>>>> transaction (mainly because http is not a transactional protocol), so
>>>> in order to have your process transacted, I would suggest the use of
>>>> two JMS endpoints between http and the CBR.  The first JMS endpoint
>>>> (provider) would not be transacted, but the second one would be.
>>>>
>>>> On Fri, Sep 26, 2008 at 8:01 AM, sachin2008 <es...@gmail.com>
>>>> wrote:
>>>>>
>>>>> Hi ,
>>>>>
>>>>> I have some query on the servicemix transactions.
>>>>>
>>>>> Im my code exchange.isTransacted() is returnning false in the
>>>>> components
>>>>> like eip, drools and other components.
>>>>>
>>>>> When I look into the CBR code, I found that  if exchange.isTransacted()
>>>>> returns false, then EIPEndpoint invoked processAsync of CBR. This
>>>>> inturn
>>>>> calls the other components using send() i.e using asynchronous
>>>>> communication.
>>>>>
>>>>> Is my assumtioon of CBR uses async communication is correct or not?
>>>>>
>>>>> if this is correct, assume the follwing scenario.
>>>>>
>>>>> http -> CBR -> bean.
>>>>>
>>>>> In the above scenario CBR invokes bean using async(). But, in case of
>>>>> async
>>>>> processing, component threads comes into picture.  For example, if I
>>>>> set
>>>>> the
>>>>> corePoolThreadSize and MaximumPoolSize all as 1 for the bean component,
>>>>> only
>>>>> 1 request will be processed by the bean at a time.  Then in this case,
>>>>> all
>>>>> the requests to the bean component needs to  wait in the  queue.
>>>>>
>>>>> Is this correct ?
>>>>>
>>>>> Please clarify this as this ASAp as it is very important to us.
>>>>>
>>>>>
>>>>> -----
>>>>> Cheers
>>>>> Praveen Oruganti
>>>>> "Think before you act and act on what you believe"
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Reg-%3A-Servicemix-transactions-and-component-thread-pool-tp19682972p19682972.html
>>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Cheers,
>>>> Guillaume Nodet
>>>> ------------------------
>>>> Blog: http://gnodet.blogspot.com/
>>>> ------------------------
>>>> Open Source SOA
>>>> http://open.iona.com
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Reg-%3A-Servicemix-transactions-and-component-thread-pool-tp19682972p19969785.html
>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Reg-%3A-Servicemix-transactions-and-component-thread-pool-tp19682972p19970546.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: Reg : Servicemix transactions and component thread pool

Posted by dhoni2008 <go...@rediffmail.com>.
Yes my exchanges are not being transacted as i am using http and the
transactions inititated by http never get transacted. 

But my doubt is , exchanges are not transacted so, eip calls bean using
send(). And this request  will be executed by the bean component
immediately. But, the remaing requests needs to be waited for the first
request to be complete. 

And my doubt is why this is not happening. as the eip is calling  bean using
in an asynchronous fashion, why more than one request is being processed
simultaneously.

Regards
Gopi Krishna


gnodet wrote:
> 
> This may be because your exchanges are not really transacted.  What's
> the configuration you used ?
> 
> On Tue, Oct 14, 2008 at 11:18 AM, dhoni2008
> <go...@rediffmail.com> wrote:
>>
>> Hi,
>>
>> we have done a poc as mentioned in this post and we expect all the
>> requests
>> to be wait in the  queue.
>> But, the result that we got is a different.   Scneario that we tested is
>> as
>> follows:
>>
>> http - CBR - bean.
>>
>> In the bean component, we are introducing some delay with
>> Tread.sleep(10000)
>> during processing. Also we are logging message "Received Exchange"  after
>> bean component receives the exchange and "Sending Exchange".
>>
>> if we sent 10 parallel requests from the http endpoint, the outcome
>> should
>> be
>>
>> Received exchange
>> Sending exchange
>> Received Exchange
>> SendingExchange
>> ....
>>
>> But the response that we got is,
>> Received exchange
>> Received exchange
>> Received exchange
>> .....
>> Sending exchange
>> Sending exchange
>> Sending exchange
>> Sending exchange
>> Sending exchange
>>
>> ....
>>
>> This means no request are being waiting in the queue.
>>
>> Our thread pool configuration is as follows:
>>
>> servicemix.corePoolSize    = 1
>> servicemix.maximumPoolSize = 1
>> servicemix.queueSize       = 0
>>
>> Regards
>> Dhoni 2008.
>>
>>
>>
>>
>> gnodet wrote:
>>>
>>> Yes, everything is correct.
>>>
>>> Wrt transactions, the http component is currently not able to start a
>>> transaction (mainly because http is not a transactional protocol), so
>>> in order to have your process transacted, I would suggest the use of
>>> two JMS endpoints between http and the CBR.  The first JMS endpoint
>>> (provider) would not be transacted, but the second one would be.
>>>
>>> On Fri, Sep 26, 2008 at 8:01 AM, sachin2008 <es...@gmail.com>
>>> wrote:
>>>>
>>>> Hi ,
>>>>
>>>> I have some query on the servicemix transactions.
>>>>
>>>> Im my code exchange.isTransacted() is returnning false in the
>>>> components
>>>> like eip, drools and other components.
>>>>
>>>> When I look into the CBR code, I found that  if exchange.isTransacted()
>>>> returns false, then EIPEndpoint invoked processAsync of CBR. This
>>>> inturn
>>>> calls the other components using send() i.e using asynchronous
>>>> communication.
>>>>
>>>> Is my assumtioon of CBR uses async communication is correct or not?
>>>>
>>>> if this is correct, assume the follwing scenario.
>>>>
>>>> http -> CBR -> bean.
>>>>
>>>> In the above scenario CBR invokes bean using async(). But, in case of
>>>> async
>>>> processing, component threads comes into picture.  For example, if I
>>>> set
>>>> the
>>>> corePoolThreadSize and MaximumPoolSize all as 1 for the bean component,
>>>> only
>>>> 1 request will be processed by the bean at a time.  Then in this case,
>>>> all
>>>> the requests to the bean component needs to  wait in the  queue.
>>>>
>>>> Is this correct ?
>>>>
>>>> Please clarify this as this ASAp as it is very important to us.
>>>>
>>>>
>>>> -----
>>>> Cheers
>>>> Praveen Oruganti
>>>> "Think before you act and act on what you believe"
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Reg-%3A-Servicemix-transactions-and-component-thread-pool-tp19682972p19682972.html
>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>> ------------------------
>>> Open Source SOA
>>> http://open.iona.com
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Reg-%3A-Servicemix-transactions-and-component-thread-pool-tp19682972p19969785.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Reg-%3A-Servicemix-transactions-and-component-thread-pool-tp19682972p19970546.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Reg : Servicemix transactions and component thread pool

Posted by Guillaume Nodet <gn...@gmail.com>.
This may be because your exchanges are not really transacted.  What's
the configuration you used ?

On Tue, Oct 14, 2008 at 11:18 AM, dhoni2008
<go...@rediffmail.com> wrote:
>
> Hi,
>
> we have done a poc as mentioned in this post and we expect all the requests
> to be wait in the  queue.
> But, the result that we got is a different.   Scneario that we tested is as
> follows:
>
> http - CBR - bean.
>
> In the bean component, we are introducing some delay with Tread.sleep(10000)
> during processing. Also we are logging message "Received Exchange"  after
> bean component receives the exchange and "Sending Exchange".
>
> if we sent 10 parallel requests from the http endpoint, the outcome should
> be
>
> Received exchange
> Sending exchange
> Received Exchange
> SendingExchange
> ....
>
> But the response that we got is,
> Received exchange
> Received exchange
> Received exchange
> .....
> Sending exchange
> Sending exchange
> Sending exchange
> Sending exchange
> Sending exchange
>
> ....
>
> This means no request are being waiting in the queue.
>
> Our thread pool configuration is as follows:
>
> servicemix.corePoolSize    = 1
> servicemix.maximumPoolSize = 1
> servicemix.queueSize       = 0
>
> Regards
> Dhoni 2008.
>
>
>
>
> gnodet wrote:
>>
>> Yes, everything is correct.
>>
>> Wrt transactions, the http component is currently not able to start a
>> transaction (mainly because http is not a transactional protocol), so
>> in order to have your process transacted, I would suggest the use of
>> two JMS endpoints between http and the CBR.  The first JMS endpoint
>> (provider) would not be transacted, but the second one would be.
>>
>> On Fri, Sep 26, 2008 at 8:01 AM, sachin2008 <es...@gmail.com> wrote:
>>>
>>> Hi ,
>>>
>>> I have some query on the servicemix transactions.
>>>
>>> Im my code exchange.isTransacted() is returnning false in the components
>>> like eip, drools and other components.
>>>
>>> When I look into the CBR code, I found that  if exchange.isTransacted()
>>> returns false, then EIPEndpoint invoked processAsync of CBR. This inturn
>>> calls the other components using send() i.e using asynchronous
>>> communication.
>>>
>>> Is my assumtioon of CBR uses async communication is correct or not?
>>>
>>> if this is correct, assume the follwing scenario.
>>>
>>> http -> CBR -> bean.
>>>
>>> In the above scenario CBR invokes bean using async(). But, in case of
>>> async
>>> processing, component threads comes into picture.  For example, if I set
>>> the
>>> corePoolThreadSize and MaximumPoolSize all as 1 for the bean component,
>>> only
>>> 1 request will be processed by the bean at a time.  Then in this case,
>>> all
>>> the requests to the bean component needs to  wait in the  queue.
>>>
>>> Is this correct ?
>>>
>>> Please clarify this as this ASAp as it is very important to us.
>>>
>>>
>>> -----
>>> Cheers
>>> Praveen Oruganti
>>> "Think before you act and act on what you believe"
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Reg-%3A-Servicemix-transactions-and-component-thread-pool-tp19682972p19682972.html
>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://open.iona.com
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Reg-%3A-Servicemix-transactions-and-component-thread-pool-tp19682972p19969785.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com