You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Philippe Mouawad <pm...@apache.org> on 2017/10/09 21:19:12 UTC

Migration to HC4/HC5 last version

Hello,
Within JMeter projet I am working on migration fully to last APIs of
HttpClient:

   - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757

You can see current code here:

   - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION

I have nearly completed the work except for 2 remaining items:

   - Virtual Host:
      - I don't see this parameter in newer interfaces
         -
         https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117


   - "Slow " connection feature:
      - This feature allows to simulate slow connection. Currently we wrap
      Input/Output stream returned by socket with
SlowInputStream/SlowOutputStream
      -
         https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java
         -
         https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322
         -
         https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892
      - It is not clear for me how this feature should be implemented:
         - Should we adapt SSLSocket and Socket with a Slow feature ?


Hope you can help by pointing me to the components.

Thanks

Regards

Philippe M.

@philmdot

Re: Migration to HC4/HC5 last version

Posted by Philippe Mouawad <ph...@gmail.com>.
No problem Oleg, answering after 2 days is pretty acceptable and you're
doing this on your personal time so I have nothing to say.

I hope you'll handle your personal and work issues and be in a better state
, good luck

On Thu, Oct 12, 2017 at 10:50 AM, Oleg Kalnichevski <ol...@apache.org>
wrote:

> On Wed, 2017-10-11 at 20:55 +0200, Philippe Mouawad wrote:
> > Hello Team,
> > Pinging again in case somebody can help.
> > Regards
> >
>
> My apologies, Philippe
>
> I was (still am) buried under with work related and personal issues.
>
> Oleg
>
>
> >
> > On Mon, Oct 9, 2017 at 11:19 PM, Philippe Mouawad <pmouawad@apache.or
> > g>
> > wrote:
> >
> > > Hello,
> > > Within JMeter projet I am working on migration fully to last APIs
> > > of
> > > HttpClient:
> > >
> > >    - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
> > >
> > > You can see current code here:
> > >
> > >    - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
> > >
> > > I have nearly completed the work except for 2 remaining items:
> > >
> > >    - Virtual Host:
> > >       - I don't see this parameter in newer interfaces
> > >          - https://github.com/apache/jmeter/blob/trunk/src/
> > >          protocol/http/org/apache/jmeter/protocol/http/sampler/
> > >          HTTPHC4Impl.java#L1117
> > >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > > http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117
> > > >
> > >
> > >
> > >    - "Slow " connection feature:
> > >       - This feature allows to simulate slow connection. Currently
> > > we
> > >       wrap Input/Output stream returned by socket with
> > > SlowInputStream/
> > >       SlowOutputStream
> > >       - https://github.com/apache/jmeter/blob/trunk/src/
> > >          protocol/http/org/apache/jmeter/protocol/http/util/
> > >          SlowHC4SocketFactory.java
> > >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > > http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java
> > > >
> > >          - https://github.com/apache/jmeter/blob/trunk/src/
> > >          protocol/http/org/apache/jmeter/protocol/http/sampler/
> > >          HTTPHC4Impl.java#L322
> > >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > > http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
> > >          - https://github.com/apache/jmeter/blob/trunk/src/
> > >          protocol/http/org/apache/jmeter/protocol/http/sampler/
> > >          HTTPHC4Impl.java#L892
> > >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > > http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
> > >       - It is not clear for me how this feature should be
> > > implemented:
> > >          - Should we adapt SSLSocket and Socket with a Slow feature
> > > ?
> > >
> > >
> > > Hope you can help by pointing me to the components.
> > >
> > > Thanks
> > >
> > > Regards
> > >
> > > Philippe M.
> > >
> > > @philmdot
> > >
>



-- 
Cordialement.
Philippe Mouawad.

Re: Migration to HC4/HC5 last version

Posted by Philippe Mouawad <ph...@gmail.com>.
No problem Oleg, answering after 2 days is pretty acceptable and you're
doing this on your personal time so I have nothing to say.

I hope you'll handle your personal and work issues and be in a better state
, good luck

On Thu, Oct 12, 2017 at 10:50 AM, Oleg Kalnichevski <ol...@apache.org>
wrote:

> On Wed, 2017-10-11 at 20:55 +0200, Philippe Mouawad wrote:
> > Hello Team,
> > Pinging again in case somebody can help.
> > Regards
> >
>
> My apologies, Philippe
>
> I was (still am) buried under with work related and personal issues.
>
> Oleg
>
>
> >
> > On Mon, Oct 9, 2017 at 11:19 PM, Philippe Mouawad <pmouawad@apache.or
> > g>
> > wrote:
> >
> > > Hello,
> > > Within JMeter projet I am working on migration fully to last APIs
> > > of
> > > HttpClient:
> > >
> > >    - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
> > >
> > > You can see current code here:
> > >
> > >    - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
> > >
> > > I have nearly completed the work except for 2 remaining items:
> > >
> > >    - Virtual Host:
> > >       - I don't see this parameter in newer interfaces
> > >          - https://github.com/apache/jmeter/blob/trunk/src/
> > >          protocol/http/org/apache/jmeter/protocol/http/sampler/
> > >          HTTPHC4Impl.java#L1117
> > >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > > http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117
> > > >
> > >
> > >
> > >    - "Slow " connection feature:
> > >       - This feature allows to simulate slow connection. Currently
> > > we
> > >       wrap Input/Output stream returned by socket with
> > > SlowInputStream/
> > >       SlowOutputStream
> > >       - https://github.com/apache/jmeter/blob/trunk/src/
> > >          protocol/http/org/apache/jmeter/protocol/http/util/
> > >          SlowHC4SocketFactory.java
> > >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > > http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java
> > > >
> > >          - https://github.com/apache/jmeter/blob/trunk/src/
> > >          protocol/http/org/apache/jmeter/protocol/http/sampler/
> > >          HTTPHC4Impl.java#L322
> > >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > > http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
> > >          - https://github.com/apache/jmeter/blob/trunk/src/
> > >          protocol/http/org/apache/jmeter/protocol/http/sampler/
> > >          HTTPHC4Impl.java#L892
> > >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > > http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
> > >       - It is not clear for me how this feature should be
> > > implemented:
> > >          - Should we adapt SSLSocket and Socket with a Slow feature
> > > ?
> > >
> > >
> > > Hope you can help by pointing me to the components.
> > >
> > > Thanks
> > >
> > > Regards
> > >
> > > Philippe M.
> > >
> > > @philmdot
> > >
>



-- 
Cordialement.
Philippe Mouawad.

Re: Migration to HC4/HC5 last version

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2017-10-11 at 20:55 +0200, Philippe Mouawad wrote:
> Hello Team,
> Pinging again in case somebody can help.
> Regards
> 

My apologies, Philippe

I was (still am) buried under with work related and personal issues.

Oleg


> 
> On Mon, Oct 9, 2017 at 11:19 PM, Philippe Mouawad <pmouawad@apache.or
> g>
> wrote:
> 
> > Hello,
> > Within JMeter projet I am working on migration fully to last APIs
> > of
> > HttpClient:
> > 
> >    - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
> > 
> > You can see current code here:
> > 
> >    - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
> > 
> > I have nearly completed the work except for 2 remaining items:
> > 
> >    - Virtual Host:
> >       - I don't see this parameter in newer interfaces
> >          - https://github.com/apache/jmeter/blob/trunk/src/
> >          protocol/http/org/apache/jmeter/protocol/http/sampler/
> >          HTTPHC4Impl.java#L1117
> >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117
> > >
> > 
> > 
> >    - "Slow " connection feature:
> >       - This feature allows to simulate slow connection. Currently
> > we
> >       wrap Input/Output stream returned by socket with
> > SlowInputStream/
> >       SlowOutputStream
> >       - https://github.com/apache/jmeter/blob/trunk/src/
> >          protocol/http/org/apache/jmeter/protocol/http/util/
> >          SlowHC4SocketFactory.java
> >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java
> > >
> >          - https://github.com/apache/jmeter/blob/trunk/src/
> >          protocol/http/org/apache/jmeter/protocol/http/sampler/
> >          HTTPHC4Impl.java#L322
> >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
> >          - https://github.com/apache/jmeter/blob/trunk/src/
> >          protocol/http/org/apache/jmeter/protocol/http/sampler/
> >          HTTPHC4Impl.java#L892
> >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
> >       - It is not clear for me how this feature should be
> > implemented:
> >          - Should we adapt SSLSocket and Socket with a Slow feature
> > ?
> > 
> > 
> > Hope you can help by pointing me to the components.
> > 
> > Thanks
> > 
> > Regards
> > 
> > Philippe M.
> > 
> > @philmdot
> > 

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Migration to HC4/HC5 last version

Posted by Philippe Mouawad <ph...@gmail.com>.
Thanks for your help Aleksei
So 1 question remains for me:

   - "Slow " connection feature:
      - This feature allows to simulate slow connection. Currently we wrap
      Input/Output stream returned by socket with SlowInputStream/
      SlowOutputStream
      - https://github.com/apache/jmeter/blob/trunk/src/
         protocol/http/org/apache/jmeter/protocol/http/util/
         SlowHC4SocketFactory.java
         <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java>
         - https://github.com/apache/jmeter/blob/trunk/src/
         protocol/http/org/apache/jmeter/protocol/http/sampler/
         HTTPHC4Impl.java#L322
         <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
         - https://github.com/apache/jmeter/blob/trunk/src/
         protocol/http/org/apache/jmeter/protocol/http/sampler/
         HTTPHC4Impl.java#L892
         <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
      - It is not clear for me how this feature should be implemented:
         - Should we adapt SSLSocket and Socket with a Slow feature ?


Regards

On Thu, Oct 12, 2017 at 9:41 AM, Aleksei Balan <ab...@gmail.com>
wrote:

> Hello Philippe Mouawad,
>
> I think the idea of getting rid of virtual host is to simplify the
> object design.
> Virtual host functionality can be reduced to simple setting of the
> "Host" header in http request.
> You can see the example of virtual host implementation for httpclient 5.0
> here
> https://github.com/abalanonline/httpclient4to5
>
> Aleksei Balan
>
>
>
> On 10/11/17, Philippe Mouawad <pm...@apache.org> wrote:
> > Hello Team,
> > Pinging again in case somebody can help.
> > Regards
> >
> >
> > On Mon, Oct 9, 2017 at 11:19 PM, Philippe Mouawad <pm...@apache.org>
> > wrote:
> >
> >> Hello,
> >> Within JMeter projet I am working on migration fully to last APIs of
> >> HttpClient:
> >>
> >>    - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
> >>
> >> You can see current code here:
> >>
> >>    - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
> >>
> >> I have nearly completed the work except for 2 remaining items:
> >>
> >>    - Virtual Host:
> >>       - I don't see this parameter in newer interfaces
> >>          - https://github.com/apache/jmeter/blob/trunk/src/
> >>          protocol/http/org/apache/jmeter/protocol/http/sampler/
> >>          HTTPHC4Impl.java#L1117
> >>
> >> <https://github.com/apache/jmeter/blob/trunk/src/
> protocol/http/org/apache/jmeter/protocol/http/sampler/
> HTTPHC4Impl.java#L1117>
> >>
> >>
> >>    - "Slow " connection feature:
> >>       - This feature allows to simulate slow connection. Currently we
> >>       wrap Input/Output stream returned by socket with SlowInputStream/
> >>       SlowOutputStream
> >>       - https://github.com/apache/jmeter/blob/trunk/src/
> >>          protocol/http/org/apache/jmeter/protocol/http/util/
> >>          SlowHC4SocketFactory.java
> >>
> >> <https://github.com/apache/jmeter/blob/trunk/src/
> protocol/http/org/apache/jmeter/protocol/http/util/
> SlowHC4SocketFactory.java>
> >>          - https://github.com/apache/jmeter/blob/trunk/src/
> >>          protocol/http/org/apache/jmeter/protocol/http/sampler/
> >>          HTTPHC4Impl.java#L322
> >>
> >> <https://github.com/apache/jmeter/blob/trunk/src/
> protocol/http/org/apache/jmeter/protocol/http/sampler/
> HTTPHC4Impl.java#L322>
> >>          - https://github.com/apache/jmeter/blob/trunk/src/
> >>          protocol/http/org/apache/jmeter/protocol/http/sampler/
> >>          HTTPHC4Impl.java#L892
> >>
> >> <https://github.com/apache/jmeter/blob/trunk/src/
> protocol/http/org/apache/jmeter/protocol/http/sampler/
> HTTPHC4Impl.java#L892>
> >>       - It is not clear for me how this feature should be implemented:
> >>          - Should we adapt SSLSocket and Socket with a Slow feature ?
> >>
> >>
> >> Hope you can help by pointing me to the components.
> >>
> >> Thanks
> >>
> >> Regards
> >>
> >> Philippe M.
> >>
> >> @philmdot
> >>
> >
>



-- 
Cordialement.
Philippe Mouawad.

Re: Migration to HC4/HC5 last version

Posted by Philippe Mouawad <ph...@gmail.com>.
Thanks for your help Aleksei
So 1 question remains for me:

   - "Slow " connection feature:
      - This feature allows to simulate slow connection. Currently we wrap
      Input/Output stream returned by socket with SlowInputStream/
      SlowOutputStream
      - https://github.com/apache/jmeter/blob/trunk/src/
         protocol/http/org/apache/jmeter/protocol/http/util/
         SlowHC4SocketFactory.java
         <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java>
         - https://github.com/apache/jmeter/blob/trunk/src/
         protocol/http/org/apache/jmeter/protocol/http/sampler/
         HTTPHC4Impl.java#L322
         <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
         - https://github.com/apache/jmeter/blob/trunk/src/
         protocol/http/org/apache/jmeter/protocol/http/sampler/
         HTTPHC4Impl.java#L892
         <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
      - It is not clear for me how this feature should be implemented:
         - Should we adapt SSLSocket and Socket with a Slow feature ?


Regards

On Thu, Oct 12, 2017 at 9:41 AM, Aleksei Balan <ab...@gmail.com>
wrote:

> Hello Philippe Mouawad,
>
> I think the idea of getting rid of virtual host is to simplify the
> object design.
> Virtual host functionality can be reduced to simple setting of the
> "Host" header in http request.
> You can see the example of virtual host implementation for httpclient 5.0
> here
> https://github.com/abalanonline/httpclient4to5
>
> Aleksei Balan
>
>
>
> On 10/11/17, Philippe Mouawad <pm...@apache.org> wrote:
> > Hello Team,
> > Pinging again in case somebody can help.
> > Regards
> >
> >
> > On Mon, Oct 9, 2017 at 11:19 PM, Philippe Mouawad <pm...@apache.org>
> > wrote:
> >
> >> Hello,
> >> Within JMeter projet I am working on migration fully to last APIs of
> >> HttpClient:
> >>
> >>    - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
> >>
> >> You can see current code here:
> >>
> >>    - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
> >>
> >> I have nearly completed the work except for 2 remaining items:
> >>
> >>    - Virtual Host:
> >>       - I don't see this parameter in newer interfaces
> >>          - https://github.com/apache/jmeter/blob/trunk/src/
> >>          protocol/http/org/apache/jmeter/protocol/http/sampler/
> >>          HTTPHC4Impl.java#L1117
> >>
> >> <https://github.com/apache/jmeter/blob/trunk/src/
> protocol/http/org/apache/jmeter/protocol/http/sampler/
> HTTPHC4Impl.java#L1117>
> >>
> >>
> >>    - "Slow " connection feature:
> >>       - This feature allows to simulate slow connection. Currently we
> >>       wrap Input/Output stream returned by socket with SlowInputStream/
> >>       SlowOutputStream
> >>       - https://github.com/apache/jmeter/blob/trunk/src/
> >>          protocol/http/org/apache/jmeter/protocol/http/util/
> >>          SlowHC4SocketFactory.java
> >>
> >> <https://github.com/apache/jmeter/blob/trunk/src/
> protocol/http/org/apache/jmeter/protocol/http/util/
> SlowHC4SocketFactory.java>
> >>          - https://github.com/apache/jmeter/blob/trunk/src/
> >>          protocol/http/org/apache/jmeter/protocol/http/sampler/
> >>          HTTPHC4Impl.java#L322
> >>
> >> <https://github.com/apache/jmeter/blob/trunk/src/
> protocol/http/org/apache/jmeter/protocol/http/sampler/
> HTTPHC4Impl.java#L322>
> >>          - https://github.com/apache/jmeter/blob/trunk/src/
> >>          protocol/http/org/apache/jmeter/protocol/http/sampler/
> >>          HTTPHC4Impl.java#L892
> >>
> >> <https://github.com/apache/jmeter/blob/trunk/src/
> protocol/http/org/apache/jmeter/protocol/http/sampler/
> HTTPHC4Impl.java#L892>
> >>       - It is not clear for me how this feature should be implemented:
> >>          - Should we adapt SSLSocket and Socket with a Slow feature ?
> >>
> >>
> >> Hope you can help by pointing me to the components.
> >>
> >> Thanks
> >>
> >> Regards
> >>
> >> Philippe M.
> >>
> >> @philmdot
> >>
> >
>



-- 
Cordialement.
Philippe Mouawad.

Re: Migration to HC4/HC5 last version

Posted by Aleksei Balan <ab...@gmail.com>.
Hello Philippe Mouawad,

I think the idea of getting rid of virtual host is to simplify the
object design.
Virtual host functionality can be reduced to simple setting of the
"Host" header in http request.
You can see the example of virtual host implementation for httpclient 5.0 here
https://github.com/abalanonline/httpclient4to5

Aleksei Balan



On 10/11/17, Philippe Mouawad <pm...@apache.org> wrote:
> Hello Team,
> Pinging again in case somebody can help.
> Regards
>
>
> On Mon, Oct 9, 2017 at 11:19 PM, Philippe Mouawad <pm...@apache.org>
> wrote:
>
>> Hello,
>> Within JMeter projet I am working on migration fully to last APIs of
>> HttpClient:
>>
>>    - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
>>
>> You can see current code here:
>>
>>    - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
>>
>> I have nearly completed the work except for 2 remaining items:
>>
>>    - Virtual Host:
>>       - I don't see this parameter in newer interfaces
>>          - https://github.com/apache/jmeter/blob/trunk/src/
>>          protocol/http/org/apache/jmeter/protocol/http/sampler/
>>          HTTPHC4Impl.java#L1117
>>
>> <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117>
>>
>>
>>    - "Slow " connection feature:
>>       - This feature allows to simulate slow connection. Currently we
>>       wrap Input/Output stream returned by socket with SlowInputStream/
>>       SlowOutputStream
>>       - https://github.com/apache/jmeter/blob/trunk/src/
>>          protocol/http/org/apache/jmeter/protocol/http/util/
>>          SlowHC4SocketFactory.java
>>
>> <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java>
>>          - https://github.com/apache/jmeter/blob/trunk/src/
>>          protocol/http/org/apache/jmeter/protocol/http/sampler/
>>          HTTPHC4Impl.java#L322
>>
>> <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
>>          - https://github.com/apache/jmeter/blob/trunk/src/
>>          protocol/http/org/apache/jmeter/protocol/http/sampler/
>>          HTTPHC4Impl.java#L892
>>
>> <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
>>       - It is not clear for me how this feature should be implemented:
>>          - Should we adapt SSLSocket and Socket with a Slow feature ?
>>
>>
>> Hope you can help by pointing me to the components.
>>
>> Thanks
>>
>> Regards
>>
>> Philippe M.
>>
>> @philmdot
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Migration to HC4/HC5 last version

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2017-10-11 at 20:55 +0200, Philippe Mouawad wrote:
> Hello Team,
> Pinging again in case somebody can help.
> Regards
> 

My apologies, Philippe

I was (still am) buried under with work related and personal issues.

Oleg


> 
> On Mon, Oct 9, 2017 at 11:19 PM, Philippe Mouawad <pmouawad@apache.or
> g>
> wrote:
> 
> > Hello,
> > Within JMeter projet I am working on migration fully to last APIs
> > of
> > HttpClient:
> > 
> >    - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
> > 
> > You can see current code here:
> > 
> >    - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
> > 
> > I have nearly completed the work except for 2 remaining items:
> > 
> >    - Virtual Host:
> >       - I don't see this parameter in newer interfaces
> >          - https://github.com/apache/jmeter/blob/trunk/src/
> >          protocol/http/org/apache/jmeter/protocol/http/sampler/
> >          HTTPHC4Impl.java#L1117
> >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117
> > >
> > 
> > 
> >    - "Slow " connection feature:
> >       - This feature allows to simulate slow connection. Currently
> > we
> >       wrap Input/Output stream returned by socket with
> > SlowInputStream/
> >       SlowOutputStream
> >       - https://github.com/apache/jmeter/blob/trunk/src/
> >          protocol/http/org/apache/jmeter/protocol/http/util/
> >          SlowHC4SocketFactory.java
> >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java
> > >
> >          - https://github.com/apache/jmeter/blob/trunk/src/
> >          protocol/http/org/apache/jmeter/protocol/http/sampler/
> >          HTTPHC4Impl.java#L322
> >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
> >          - https://github.com/apache/jmeter/blob/trunk/src/
> >          protocol/http/org/apache/jmeter/protocol/http/sampler/
> >          HTTPHC4Impl.java#L892
> >          <https://github.com/apache/jmeter/blob/trunk/src/protocol/
> > http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
> >       - It is not clear for me how this feature should be
> > implemented:
> >          - Should we adapt SSLSocket and Socket with a Slow feature
> > ?
> > 
> > 
> > Hope you can help by pointing me to the components.
> > 
> > Thanks
> > 
> > Regards
> > 
> > Philippe M.
> > 
> > @philmdot
> > 

Re: Migration to HC4/HC5 last version

Posted by Aleksei Balan <ab...@gmail.com>.
Hello Philippe Mouawad,

I think the idea of getting rid of virtual host is to simplify the
object design.
Virtual host functionality can be reduced to simple setting of the
"Host" header in http request.
You can see the example of virtual host implementation for httpclient 5.0 here
https://github.com/abalanonline/httpclient4to5

Aleksei Balan



On 10/11/17, Philippe Mouawad <pm...@apache.org> wrote:
> Hello Team,
> Pinging again in case somebody can help.
> Regards
>
>
> On Mon, Oct 9, 2017 at 11:19 PM, Philippe Mouawad <pm...@apache.org>
> wrote:
>
>> Hello,
>> Within JMeter projet I am working on migration fully to last APIs of
>> HttpClient:
>>
>>    - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
>>
>> You can see current code here:
>>
>>    - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
>>
>> I have nearly completed the work except for 2 remaining items:
>>
>>    - Virtual Host:
>>       - I don't see this parameter in newer interfaces
>>          - https://github.com/apache/jmeter/blob/trunk/src/
>>          protocol/http/org/apache/jmeter/protocol/http/sampler/
>>          HTTPHC4Impl.java#L1117
>>
>> <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117>
>>
>>
>>    - "Slow " connection feature:
>>       - This feature allows to simulate slow connection. Currently we
>>       wrap Input/Output stream returned by socket with SlowInputStream/
>>       SlowOutputStream
>>       - https://github.com/apache/jmeter/blob/trunk/src/
>>          protocol/http/org/apache/jmeter/protocol/http/util/
>>          SlowHC4SocketFactory.java
>>
>> <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java>
>>          - https://github.com/apache/jmeter/blob/trunk/src/
>>          protocol/http/org/apache/jmeter/protocol/http/sampler/
>>          HTTPHC4Impl.java#L322
>>
>> <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
>>          - https://github.com/apache/jmeter/blob/trunk/src/
>>          protocol/http/org/apache/jmeter/protocol/http/sampler/
>>          HTTPHC4Impl.java#L892
>>
>> <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
>>       - It is not clear for me how this feature should be implemented:
>>          - Should we adapt SSLSocket and Socket with a Slow feature ?
>>
>>
>> Hope you can help by pointing me to the components.
>>
>> Thanks
>>
>> Regards
>>
>> Philippe M.
>>
>> @philmdot
>>
>

Re: Migration to HC4/HC5 last version

Posted by Philippe Mouawad <pm...@apache.org>.
Hello Team,
Pinging again in case somebody can help.
Regards


On Mon, Oct 9, 2017 at 11:19 PM, Philippe Mouawad <pm...@apache.org>
wrote:

> Hello,
> Within JMeter projet I am working on migration fully to last APIs of
> HttpClient:
>
>    - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
>
> You can see current code here:
>
>    - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
>
> I have nearly completed the work except for 2 remaining items:
>
>    - Virtual Host:
>       - I don't see this parameter in newer interfaces
>          - https://github.com/apache/jmeter/blob/trunk/src/
>          protocol/http/org/apache/jmeter/protocol/http/sampler/
>          HTTPHC4Impl.java#L1117
>          <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117>
>
>
>    - "Slow " connection feature:
>       - This feature allows to simulate slow connection. Currently we
>       wrap Input/Output stream returned by socket with SlowInputStream/
>       SlowOutputStream
>       - https://github.com/apache/jmeter/blob/trunk/src/
>          protocol/http/org/apache/jmeter/protocol/http/util/
>          SlowHC4SocketFactory.java
>          <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java>
>          - https://github.com/apache/jmeter/blob/trunk/src/
>          protocol/http/org/apache/jmeter/protocol/http/sampler/
>          HTTPHC4Impl.java#L322
>          <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
>          - https://github.com/apache/jmeter/blob/trunk/src/
>          protocol/http/org/apache/jmeter/protocol/http/sampler/
>          HTTPHC4Impl.java#L892
>          <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
>       - It is not clear for me how this feature should be implemented:
>          - Should we adapt SSLSocket and Socket with a Slow feature ?
>
>
> Hope you can help by pointing me to the components.
>
> Thanks
>
> Regards
>
> Philippe M.
>
> @philmdot
>

Re: Migration to HC4/HC5 last version

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2017-10-12 at 11:40 -0600, Gary Gregory wrote:
> On Oct 12, 2017 02:48, "Oleg Kalnichevski" <ol...@apache.org> wrote:
> 

...

> 
> Maybe this could be a contribution in our test code? It does not seem
> to
> really belong in main... unless it is used to enable throttling which
> seems
> like a neat idea for any server. So I would put in it main, but
> that's just
> me.
> 
> Gary
> 

Yes, HC 5.0 (core and client) now have 'testing' modules specifically
for re-usable integration / load test components.  

It would likely be a good place for throttling code.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Migration to HC4/HC5 last version

Posted by Gary Gregory <ga...@gmail.com>.
On Oct 12, 2017 02:48, "Oleg Kalnichevski" <ol...@apache.org> wrote:

On Mon, 2017-10-09 at 23:19 +0200, Philippe Mouawad wrote:
> Hello,
> Within JMeter projet I am working on migration fully to last APIs of
> HttpClient:
>
>    - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
>
> You can see current code here:
>
>    - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
>
> I have nearly completed the work except for 2 remaining items:
>
>    - Virtual Host:
>       - I don't see this parameter in newer interfaces
>          -
>          https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
> p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117
>

The virtual parameter in HC 4.x was a left-over from HC 3.x. It should
have never been introduced in the first place.

Please consider executing requests with an explicit target HttpHost and
a 'virtual' host in the request URI.

https://github.com/apache/httpcomponents-client/blob/master/httpclient5
/src/main/java/org/apache/hc/client5/http/classic/HttpClient.java#L95

HttpHost should represent a physical host, whereas request URI may
contain any arbitrary host name.

---
HttpHost target = new HttpHost("www.google.com");
HttpGet httpGet = new HttpGet("http://google.ru/");
CloseableHttpResponse response = client.execute(target, httpGet);
---


>
>    - "Slow " connection feature:
>       - This feature allows to simulate slow connection. Currently we
> wrap
>       Input/Output stream returned by socket with
> SlowInputStream/SlowOutputStream
>       -
>          https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
> p/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java
>          -
>          https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
> p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322
>          -
>          https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
> p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892
>       - It is not clear for me how this feature should be
> implemented:
>          - Should we adapt SSLSocket and Socket with a Slow feature ?
>
>
> Hope you can help by pointing me to the components.
>

I think all you need to do is to extend PlainConnectionSocketFactory or
provide a custom one and return a 'slow' socket from #createSocket
method.


Maybe this could be a contribution in our test code? It does not seem to
really belong in main... unless it is used to enable throttling which seems
like a neat idea for any server. So I would put in it main, but that's just
me.

Gary


https://github.com/apache/httpcomponents-client/blob/master/httpclient5
/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketF
actory.java

Hope this helps

Oleg


> Thanks
>
> Regards
>
> Philippe M.
>
> @philmdot

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

Re: Migration to HC4/HC5 last version

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2017-10-09 at 23:19 +0200, Philippe Mouawad wrote:
> Hello,
> Within JMeter projet I am working on migration fully to last APIs of
> HttpClient:
> 
>    - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
> 
> You can see current code here:
> 
>    - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
> 
> I have nearly completed the work except for 2 remaining items:
> 
>    - Virtual Host:
>       - I don't see this parameter in newer interfaces
>          -
>          https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
> p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117
> 

The virtual parameter in HC 4.x was a left-over from HC 3.x. It should
have never been introduced in the first place.

Please consider executing requests with an explicit target HttpHost and
a 'virtual' host in the request URI.

https://github.com/apache/httpcomponents-client/blob/master/httpclient5
/src/main/java/org/apache/hc/client5/http/classic/HttpClient.java#L95

HttpHost should represent a physical host, whereas request URI may
contain any arbitrary host name.

---
HttpHost target = new HttpHost("www.google.com");
HttpGet httpGet = new HttpGet("http://google.ru/");
CloseableHttpResponse response = client.execute(target, httpGet);
---


> 
>    - "Slow " connection feature:
>       - This feature allows to simulate slow connection. Currently we
> wrap
>       Input/Output stream returned by socket with
> SlowInputStream/SlowOutputStream
>       -
>          https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
> p/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java
>          -
>          https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
> p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322
>          -
>          https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
> p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892
>       - It is not clear for me how this feature should be
> implemented:
>          - Should we adapt SSLSocket and Socket with a Slow feature ?
> 
> 
> Hope you can help by pointing me to the components.
> 

I think all you need to do is to extend PlainConnectionSocketFactory or
provide a custom one and return a 'slow' socket from #createSocket
method.

https://github.com/apache/httpcomponents-client/blob/master/httpclient5
/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketF
actory.java

Hope this helps

Oleg


> Thanks
> 
> Regards
> 
> Philippe M.
> 
> @philmdot

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Migration to HC4/HC5 last version

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2017-10-09 at 23:19 +0200, Philippe Mouawad wrote:
> Hello,
> Within JMeter projet I am working on migration fully to last APIs of
> HttpClient:
> 
>    - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
> 
> You can see current code here:
> 
>    - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
> 
> I have nearly completed the work except for 2 remaining items:
> 
>    - Virtual Host:
>       - I don't see this parameter in newer interfaces
>          -
>          https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
> p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117
> 

The virtual parameter in HC 4.x was a left-over from HC 3.x. It should
have never been introduced in the first place.

Please consider executing requests with an explicit target HttpHost and
a 'virtual' host in the request URI.

https://github.com/apache/httpcomponents-client/blob/master/httpclient5
/src/main/java/org/apache/hc/client5/http/classic/HttpClient.java#L95

HttpHost should represent a physical host, whereas request URI may
contain any arbitrary host name.

---
HttpHost target = new HttpHost("www.google.com");
HttpGet httpGet = new HttpGet("http://google.ru/");
CloseableHttpResponse response = client.execute(target, httpGet);
---


> 
>    - "Slow " connection feature:
>       - This feature allows to simulate slow connection. Currently we
> wrap
>       Input/Output stream returned by socket with
> SlowInputStream/SlowOutputStream
>       -
>          https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
> p/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java
>          -
>          https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
> p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322
>          -
>          https://github.com/apache/jmeter/blob/trunk/src/protocol/htt
> p/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892
>       - It is not clear for me how this feature should be
> implemented:
>          - Should we adapt SSLSocket and Socket with a Slow feature ?
> 
> 
> Hope you can help by pointing me to the components.
> 

I think all you need to do is to extend PlainConnectionSocketFactory or
provide a custom one and return a 'slow' socket from #createSocket
method.

https://github.com/apache/httpcomponents-client/blob/master/httpclient5
/src/main/java/org/apache/hc/client5/http/socket/PlainConnectionSocketF
actory.java

Hope this helps

Oleg


> Thanks
> 
> Regards
> 
> Philippe M.
> 
> @philmdot

Re: Migration to HC4/HC5 last version

Posted by Philippe Mouawad <pm...@apache.org>.
Hello Team,
Pinging again in case somebody can help.
Regards


On Mon, Oct 9, 2017 at 11:19 PM, Philippe Mouawad <pm...@apache.org>
wrote:

> Hello,
> Within JMeter projet I am working on migration fully to last APIs of
> HttpClient:
>
>    - https://bz.apache.org/bugzilla/show_bug.cgi?id=58757
>
> You can see current code here:
>
>    - https://github.com/ubikloadpack/jmeter/tree/HC4_FULL_MIGRATION
>
> I have nearly completed the work except for 2 remaining items:
>
>    - Virtual Host:
>       - I don't see this parameter in newer interfaces
>          - https://github.com/apache/jmeter/blob/trunk/src/
>          protocol/http/org/apache/jmeter/protocol/http/sampler/
>          HTTPHC4Impl.java#L1117
>          <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L1117>
>
>
>    - "Slow " connection feature:
>       - This feature allows to simulate slow connection. Currently we
>       wrap Input/Output stream returned by socket with SlowInputStream/
>       SlowOutputStream
>       - https://github.com/apache/jmeter/blob/trunk/src/
>          protocol/http/org/apache/jmeter/protocol/http/util/
>          SlowHC4SocketFactory.java
>          <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/SlowHC4SocketFactory.java>
>          - https://github.com/apache/jmeter/blob/trunk/src/
>          protocol/http/org/apache/jmeter/protocol/http/sampler/
>          HTTPHC4Impl.java#L322
>          <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L322>
>          - https://github.com/apache/jmeter/blob/trunk/src/
>          protocol/http/org/apache/jmeter/protocol/http/sampler/
>          HTTPHC4Impl.java#L892
>          <https://github.com/apache/jmeter/blob/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java#L892>
>       - It is not clear for me how this feature should be implemented:
>          - Should we adapt SSLSocket and Socket with a Slow feature ?
>
>
> Hope you can help by pointing me to the components.
>
> Thanks
>
> Regards
>
> Philippe M.
>
> @philmdot
>