[rabbitmq-discuss] RabbitMQ Java Client 2.3.1 on Android

Denis Conan Denis.Conan at telecom-sudparis.eu
Wed Feb 16 14:52:51 GMT 2011

Le 11/02/2011 11:47, Simon MacMullen a écrit :
> Hi Denis.
> On 08/02/11 12:38, Denis Conan wrote:
>> my objective is to run the Java Client on Android.
>> Do not hesitate to tell me if I started off with the wrong idea.
> That's... not unreasonable. We don't guarantee that the Java client will
> run on Android (in particular we don't test it).


thank you for your detailed answer and for the patch (not already tested).

Are you willing to consider the support of Android Java clients in the future? 
or do you consider that AMQP clients for smartphones are out of the scope of 
RabbitMQ target?

>> I didn't see any specific release for Android. So, I took the Java
>> Client for J2SE. I was able to adapt the previous version 2.2.0 of the
>> Java Client for running on Android: removal of packages json and
>> jsonrpc, and correct a call to super in the constructor of the class
>> PossibleAuthenticationFailureException.
> Ironically I think that might be fixed in 2.3.1 (it was also
> incompatible with Java 1.5).

Yes, of course, I have noticed the change.

>> As I see, the new version 2.3.1 now has authentication with SASL.
>> Unfortunately, there is no package javax.security.sasl in Android JRE.
>> So, I tried to manage this lack by replacing the classes of this package
>> by the ones in aSMACK (http://code.google.com/p/asmack/). The
>> compilation is ok, but the execution throws the following exception.
> ...but it would be a pity if the introduction of more SASL mechanisms
> were to make it unusable on Android.
>> java.io.IOException: No compatible authentication mechanism found -
>> server offered [PLAIN AMQPLAIN]
> So whatever SASL implementation you've cooked up somehow does not
> support PLAIN (I would not expect it to support AMQPLAIN).
> This seems odd, as it looks like Smack contains support for PLAIN:
> http://code.google.com/p/asmack/source/browse/src/custom/de/measite/smack/SaslClientFactory.java

If it seems odd to you, then I need to investigate more. I will let you know if 
more successful.

> If you can't get this working, then you can of course stick with the
> 2.2.0 client and an upgraded server. But being stuck with an old client
> isn't fun, so I'll have a think about how easy it would be to patch the
> old homebrew SASL back in for Android.
> Cheers, Simon


Denis Conan

More information about the rabbitmq-discuss mailing list