users@glassfish.java.net

Re: MessageEndpoint per thread pooling?

From: Henrik Olsson <henriko_at_wip.se>
Date: Fri, 26 Jun 2009 09:07:30 +0200

Hi,

Sivakumar Thyagarajan wrote:
> Hi Henrik
>
> Henrik Olsson wrote:
>> Hello,
>>
>> We've implemented a Resource Adapter and seeing some suprising
>> behaviour with MessageEndpoints. The MessageEndpoint proxy object
>> returned from the MessageEndpointFactory seems to invoke different
>> instances of the actual endpoint-object depending on which thread
>> access the proxy object. Is this correct, and intended behaviour?
>
> That does not sound correct. Could you provide more details?
> I tried a simple test with one of our devtests and I see the state being
> maintained on the MessageEndpoint (ie same MessageEndpoint instance
> is being accessed) irrespective of which thread accesses it.
>
> Here is some sample out to show what I am seeing. Note how count
> is maintained across accesses from different threads.
>> [#|2009-06-25T16:13:12.045+0530|INFO|glassfish|null|_ThreadID=71;_ThreadName=Thread-1;|[MyMessageBean]
>> --> count = 1 onMessage:: RECEIVED [0:This is message 0:WRITE]|#]
>> [#|2009-06-25T16:13:12.208+0530|INFO|glassfish|null|_ThreadID=72;_ThreadName=Thread-1;|[MyMessageBean]
>> --> count = 2 onMessage:: RECEIVED [1:This is message 1:WRITE]|#]
>
> Thanks
> --Siva.

I had trouble reproducing it with a very simple testcase too, but i
managed to create a simple project that can reproduce it reliably.
Since you said it does not sound correct i created an issue to be able
to attach my test-project at:
https://glassfish.dev.java.net/issues/show_bug.cgi?id=8592

I'm not sure what part of the test that triggers it though..

Thanks,
Henrik Olsson