Hi all,

When writing the HTTP client in CLI, I have used Java HttpUrlConnection
without going for a 3rd party libraries to maintain the size minimum as
possible.

But the REST API of the Broker admin service (which CLI client connects) is
designed using a swagger file. So instead of writing a separate HTTP client
inside the CLI, we can point it to the swagger file in the REST service and
generate a Swagger Java client and use it. With this approach, we don't
need to implement any HTTP related code, but it will only be a method call
which maps to the REST service. Even if any change happen on the side of
the REST service those will get integrated into the CLI HTTP client
seamlessly.

The only disadvantage of this swagger based approach is that it will come
with few external libraries. So those jars have to be packed into the
message-broker distribution.  Following are the extra jars needs to be
packaged,

*upgrade *gson version to 2.8.1 (+42kB)
joda-time 2.9.9 (634kB)
logging-interceptor 2.7.5 (8kB)
okhttp 2.7.5 (330kB)
okio 1.6.0 (65kB)

Also, we can implement the HTTP client using netty (netty is already
packaged in the broker distribution) as well, but since CLI client will run
on a single thread may be the overhead of using netty can be too much.
Also, we can go with libraries which has simpler abstractions as well,
HttpClient (748KB) [1] okHttp (396KB) [2].

Please let me know any thoughts on this.

[1]. https://hc.apache.org/httpcomponents-client-ga/
[2]. http://square.github.io/okhttp/

Thanks,

On Wed, Feb 21, 2018 at 5:08 PM, Eranda Rajapakshe <eran...@wso2.com> wrote:

> Hi Charitha,
>
> You will be able to find it in <BROKER_HOME>/bin directory under the name "
> broker-admin.sh".  In that release, it supports only exchanges related
> operations.
>
> Thanks,
>
> On Wed, Feb 21, 2018 at 3:25 PM, Charitha Goonetilleke <charit...@wso2.com
> > wrote:
>
>> Hi Eranda,
>>
>> I have downloaded the release from above link and tried to experience the
>> CLI client. But I wasn't able to find the separate script which can used to
>> start the client. Could you please provide me some guidance?
>>
>> Thanks & Regards,
>> /charithag
>>
>> On Fri, Feb 16, 2018 at 9:09 AM, Eranda Rajapakshe <eran...@wso2.com>
>> wrote:
>>
>>> Hi Chamila, Kavindu,
>>>
>>> Yes, we are going ahead with design 2 approach. For the moment we are
>>> including the CLI Client inside the Broker pack itself and it will start
>>> with a separate script. Also since we are packaging it inside Broker zip,
>>> we have changed the implementation language to java as it will be more
>>> smooth and we can also re-use some libraries.
>>>
>>> We have packaged an initial version of the CLI client in the latest
>>> weekly release [1]
>>>
>>> [1]. https://github.com/wso2/message-broker/releases/tag/v4.0.47
>>>
>>> Thanks,
>>>
>>> On Thu, Feb 15, 2018 at 11:04 AM, Kavindu Zoysa <kavi...@wso2.com>
>>> wrote:
>>>
>>>> Hi Eranda,
>>>>
>>>>>
>>>>> Furthermore, when implementing helper commands like `help` and
>>>>> `version`, it might be better to duplicate WUM client designs as we need 
>>>>> to
>>>>> provide a single experience for all WSO2 clients. WDYT?
>>>>>
>>>>
>>>> As Chamila mentioned it is better to duplicate WUM client designs and
>>>> implementations(both UX designs and code level implementation), because
>>>> people are using WUM for a reasonable time and, UX designs and
>>>> implementations are stable. There fore it is better to duplicate it.
>>>>
>>>> Thank you,
>>>> Kavindu
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Architecture mailing list
>>>> Architecture@wso2.org
>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>
>>>>
>>>
>>>
>>> --
>>> *Eranda Rajapakshe*
>>> Software Engineer
>>> WSO2 Inc.
>>> Mobile : +94784822608
>>>
>>> _______________________________________________
>>> Architecture mailing list
>>> Architecture@wso2.org
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>> *Charitha Goonetilleke*
>> Senior Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: +94 77 751 3669 <%2B94777513669>
>> Twitter:@CharithaWs <https://twitter.com/CharithaWs>, fb: charithag
>> <https://www.facebook.com/charithag>, linkedin: charithag
>> <http://www.linkedin.com/in/charithag>
>>
>> <http://wso2.com/signature>
>>
>
>
>
> --
> *Eranda Rajapakshe*
> Software Engineer
> WSO2 Inc.
> Mobile : +94784822608
>



-- 
*Eranda Rajapakshe*
Software Engineer
WSO2 Inc.
Mobile : +94784822608
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to