Looks Great - We would like to support it in Apache Camel

30 views
Skip to first unread message

davsclaus

unread,
Mar 5, 2010, 12:48:08 AM3/5/10
to asynchttpclient
Hi

This looks like a great and easy to use HTTP Client library. And that
it leverages async request/reply out of the box makes it even more
compelling.

I am sure we would add a camel-asynchttpclient component when 1.0 is
GA to have it supported in Apache Camel.

Keep up the good work.


Claus Ibsen
Apache Camel committer

Jeanfrancois Arcand

unread,
Mar 5, 2010, 10:21:47 AM3/5/10
to asyncht...@googlegroups.com
Salut,

On 10-03-05 12:48 AM, davsclaus wrote:
> Hi
>
> This looks like a great and easy to use HTTP Client library. And that
> it leverages async request/reply out of the box makes it even more
> compelling.
>
> I am sure we would add a camel-asynchttpclient component when 1.0 is
> GA to have it supported in Apache Camel.

This is an awesome news! Please let us know how it goes!


>
> Keep up the good work.

Thanks!

-- Jeanfrancois

davsclaus

unread,
Mar 6, 2010, 4:17:16 AM3/6/10
to asynchttpclient
Hi

Is async http client OSGi ready?
is the jars packaged as bundles and is the MANIFEST.MF osgified?

I am asking since this is usually a problem if it ain't. We would like
to be able to use your great client in Apache SMX / Apache Karaf as
well.

If you need help to setup your maven project to OSGi bundle your jars
then let us know as we got OSGi experts on staff at SMX / Karaf.


On Mar 5, 4:21 pm, Jeanfrancois Arcand <jeanfrancois.arc...@gmail.com>
wrote:

Jeanfrancois Arcand

unread,
Mar 8, 2010, 9:59:09 AM3/8/10
to asyncht...@googlegroups.com
Salut,

On 10-03-06 4:17 AM, davsclaus wrote:
> Hi
>
> Is async http client OSGi ready?
> is the jars packaged as bundles and is the MANIFEST.MF osgified?

Let me work on that today. I should have something before the end of the
day.


>
> I am asking since this is usually a problem if it ain't. We would like
> to be able to use your great client in Apache SMX / Apache Karaf as
> well.

Great!


>
> If you need help to setup your maven project to OSGi bundle your jars
> then let us know as we got OSGi experts on staff at SMX / Karaf.

If he/she can review my commit, that would be appreciated.

Thanks!

-- Jeanfrancois

Jeanfrancois Arcand

unread,
Mar 8, 2010, 2:39:09 PM3/8/10
to asyncht...@googlegroups.com
Salut,

I've added basic support:

> Counting objects: 21, done.
> Delta compression using up to 8 threads.
> Compressing objects: 100% (7/7), done.
> Writing objects: 100% (11/11), 1.53 KiB, done.
> Total 11 (delta 4), reused 0 (delta 0)
> To g...@github.com:ning/async-http-client.git
> 8dd23fb..ef96133 master -> master
I refactored to avoid a strong dependencies on NettyProvider, but the
way I load the provider (using the Thread context classloader) may cause
some issue in OSGI. Anyway take a look and let me know what you think.

A+

-- Jeanfrancois

davsclaus

unread,
Mar 9, 2010, 1:09:15 AM3/9/10
to asynchttpclient
Hi

Thanks.

I will try to ping the OSGi experts on this one.

If you do release a RC we could grab that one and try installing it in
Karaf and then see what fails. Then the OSGi experts can help address
those issues.
Most work is in maven pom.xml and having the right XML lingo so the
MANIFEST.MF files is created as it should. And having the right
version boundaries as well.

I am sure you need to add some import of that Netty provider you try
to load using ThreadContext CL. So somewhere we need to add that
package as well in the pom.xml so it gets included in the MANIFEST.MF.


On Mar 8, 8:39 pm, Jeanfrancois Arcand <jeanfrancois.arc...@gmail.com>

Jeanfrancois Arcand

unread,
Mar 9, 2010, 10:37:17 AM3/9/10
to asyncht...@googlegroups.com
Salut,

On 10-03-09 1:09 AM, davsclaus wrote:
> Hi
>
> Thanks.
>
> I will try to ping the OSGi experts on this one.
>
> If you do release a RC we could grab that one and try installing it in
> Karaf and then see what fails. Then the OSGi experts can help address
> those issues.
> Most work is in maven pom.xml and having the right XML lingo so the
> MANIFEST.MF files is created as it should. And having the right
> version boundaries as well.
>
> I am sure you need to add some import of that Netty provider you try
> to load using ThreadContext CL. So somewhere we need to add that
> package as well in the pom.xml so it gets included in the MANIFEST.MF.

Can you download the latest SNAPSHOT and try it or you need a
non-SNAPSHOT version?

* http://is.gd/a2Mvg

I'm using Felix for generating the manifest, and so far it looks like:

> Manifest-Version: 1.0
> Export-Package: com.ning.http.url,com.ning.http.collection,com.ning.ht
> tp.multipart;uses:="org.apache.log4j",com.ning.http.client;uses:="org
> .apache.log4j,com.ning.http.collection,com.ning.http.url",com.ning.ht
> tp.client.providers;uses:="org.jboss.netty.handler.timeout,org.jboss.
> netty.channel,org.jboss.netty.util,org.jboss.netty.handler.codec.http
> ,com.ning.http.client,com.ning.http.url,org.jboss.netty.buffer,org.ap
> ache.log4j,com.ning.http.multipart,org.jboss.netty.channel.socket.nio
> ,com.ning.http.collection,org.jboss.netty.util.internal,org.jboss.net
> ty.bootstrap"
> Built-By: jfarcand
> Build-Jdk: 1.6.0_17
> Bundle-Version: 1.0.0.SNAPSHOT
> Tool: Bnd-0.0.357
> Bundle-Name: async-http-client
> Bnd-LastModified: 1268093451448
> Created-By: Apache Maven Bundle Plugin
> Bundle-ManifestVersion: 2
> Bundle-SymbolicName: com.ning.async-http-client
> Import-Package: com.ning.http.client,com.ning.http.client.providers,co
> m.ning.http.collection,com.ning.http.multipart,com.ning.http.url,org.
> apache.log4j,org.jboss.netty.bootstrap;version="3.2",org.jboss.netty.
> buffer;version="3.2",org.jboss.netty.channel;version="3.2",org.jboss.
> netty.channel.socket.nio;version="3.2",org.jboss.netty.handler.codec.
> http;version="3.2",org.jboss.netty.handler.timeout;version="3.2",org.
> jboss.netty.util;version="3.2",org.jboss.netty.util.internal

Tatu Saloranta

unread,
Mar 9, 2010, 11:35:05 AM3/9/10
to asyncht...@googlegroups.com
On Tue, Mar 9, 2010 at 7:37 AM, Jeanfrancois Arcand
<jeanfranc...@gmail.com> wrote:
> Salut,
>
> On 10-03-09 1:09 AM, davsclaus wrote:
>>
>> Hi
>>
>> Thanks.
>>
>> I will try to ping the OSGi experts on this one.
>>
>> If you do release a RC we could grab that one and try installing it in
>> Karaf and then see what fails. Then the OSGi experts can help address
>> those issues.
>> Most work is in maven pom.xml and having the right XML lingo so the
>> MANIFEST.MF files is created as it should. And having the right
>> version boundaries as well.
>>
>> I am sure you need to add some import of that Netty provider you try
>> to load using ThreadContext CL. So somewhere we need to add that
>> package as well in the pom.xml so it gets included in the MANIFEST.MF.
>
> Can you download the latest SNAPSHOT and try it or you need a non-SNAPSHOT
> version?
>
>   * http://is.gd/a2Mvg
>
> I'm using Felix for generating the manifest, and so far it looks like:
>

Felix is also good at quickly testing loading and initializing of
bundles, with dependencies (load and start, or whatever sequence is).
Especially in cases where there are differences between export/import
statements of dependencies that can not be resolved by build tools
(ant and maven osgi plugins).

-+ Tatu +-

Willem

unread,
Mar 10, 2010, 3:31:08 AM3/10/10
to asynchttpclient
Hi,

I just checked out the code and build it myself.
After went through the MANIFEST, I found the bundle imports the
package which it exports.
It will introduce some kind of issue if there are more than one
asyncHttpClient bundles are installed in the OSGi container.
So I past my patch for it here.

diff --git a/pom.xml b/pom.xml
index 3ab3ccf..afa26e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,7 +69,10 @@
<extensions>true</extensions>
<configuration>
<instructions>
- <Import-Package>*</Import-Package>
+ <Import-Package>
+ !com.ning.http.*,
+ *
+ </Import-Package>
<Export-Package>
com.ning.http.*
</Export-Package>


Willem Jiang
Apache Camel committer

On Mar 8, 7:39 pm, Jeanfrancois Arcand <jeanfrancois.arc...@gmail.com>

Jeanfrancois Arcand

unread,
Mar 10, 2010, 10:56:28 AM3/10/10
to asyncht...@googlegroups.com

On 10-03-10 3:31 AM, Willem wrote:
> Hi,
>
> I just checked out the code and build it myself.
> After went through the MANIFEST, I found the bundle imports the
> package which it exports.
> It will introduce some kind of issue if there are more than one
> asyncHttpClient bundles are installed in the OSGi container.
> So I past my patch for it here.
>
> diff --git a/pom.xml b/pom.xml
> index 3ab3ccf..afa26e3 100644
> --- a/pom.xml
> +++ b/pom.xml
> @@ -69,7 +69,10 @@
> <extensions>true</extensions>
> <configuration>
> <instructions>
> -<Import-Package>*</Import-Package>
> +<Import-Package>
> + !com.ning.http.*,
> + *
> +</Import-Package>
> <Export-Package>
> com.ning.http.*
> </Export-Package>

Make sense.

Applied. Thanks a lot!

-- Jeanfrancois

Reply all
Reply to author
Forward
0 new messages