You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Jonathan Gallimore <jo...@gmail.com> on 2022/03/07 15:27:53 UTC

TOMEE-3850 https connections not reused

Hi All,

While looking at straightforward remote EJB lookup and invocation via https
in Wireshark, it looks like a different connection is being used each time,
which is causing a SSL handshake and knock-on performance impact. I've
committed a fix for this, which is to make sure the response is fully
consumed at the end of the request:
https://github.com/apache/tomee/commit/2c9a0a151bf3e51497d0338043c1ec09313512e0

Currently looking at how to add a unit test. Essentially, making two calls
to a remote EJB should both come from the same source port. The http
connection unit tests in openejb-client don't seem to pass through the
Client class as far as I can tell, and I'm not sure there's enough
contextual information available if I deploy a EJB in an Arquillian test
and call it remotely. If you have any thoughts let me know - I'll keep
plugging away at it.

Jon

Re: TOMEE-3850 https connections not reused

Posted by Jonathan Gallimore <jo...@gmail.com>.
That approach works great. thanks David. I'll have a test committed this
afternoon!

Jon

On Mon, Mar 7, 2022 at 4:59 PM David Blevins <da...@gmail.com>
wrote:

> > On Mar 7, 2022, at 7:27 AM, Jonathan Gallimore <
> jonathan.gallimore@gmail.com> wrote:
> >
> > Currently looking at how to add a unit test. Essentially, making two
> calls
> > to a remote EJB should both come from the same source port. The http
> > connection unit tests in openejb-client don't seem to pass through the
> > Client class as far as I can tell, and I'm not sure there's enough
> > contextual information available if I deploy a EJB in an Arquillian test
> > and call it remotely. If you have any thoughts let me know - I'll keep
> > plugging away at it.
>
> One approach could be to setup the access log on the server-side so that
> it logs the details needed, then use the server-composer to create/launch a
> separate TomEE process where you can make EJB calls.  Once you've made all
> the EJB calls you like, read and parse the access log to ensure all the
> calls to the `/tomee/ejb` path came from the same client host/port.
>
> Something like that would need to go into the itests as it depends on a
> TomEE tar.gz.  Here's a test I wrote recently that uses the server-composer
> (which should look familiar):
>
>  -
> https://github.com/apache/tomee/blob/master/itests/jaxrs/src/test/java/org/apache/tomee/itests/jaxrs/applogging/ApplicationLoggingTest.java#L40-L48
>
>
> -David
>
>

Re: TOMEE-3850 https connections not reused

Posted by David Blevins <da...@gmail.com>.
> On Mar 7, 2022, at 7:27 AM, Jonathan Gallimore <jo...@gmail.com> wrote:
> 
> Currently looking at how to add a unit test. Essentially, making two calls
> to a remote EJB should both come from the same source port. The http
> connection unit tests in openejb-client don't seem to pass through the
> Client class as far as I can tell, and I'm not sure there's enough
> contextual information available if I deploy a EJB in an Arquillian test
> and call it remotely. If you have any thoughts let me know - I'll keep
> plugging away at it.

One approach could be to setup the access log on the server-side so that it logs the details needed, then use the server-composer to create/launch a separate TomEE process where you can make EJB calls.  Once you've made all the EJB calls you like, read and parse the access log to ensure all the calls to the `/tomee/ejb` path came from the same client host/port.

Something like that would need to go into the itests as it depends on a TomEE tar.gz.  Here's a test I wrote recently that uses the server-composer (which should look familiar):

 - https://github.com/apache/tomee/blob/master/itests/jaxrs/src/test/java/org/apache/tomee/itests/jaxrs/applogging/ApplicationLoggingTest.java#L40-L48


-David