Subscribing to ActiveMQ from Unity3D app on Androi

2019-09-14 16:54发布

问题:

I am developing an Android app which needs to subscribe to an ActiveMQ publisher. I'm using "Apache NMS ActiveMQ" that can be found here: http://activemq.apache.org/nms/activemq-downloads.html

All was going very easy, running smoothly on the editor, and standalone(.exe). Problem happens when I try to run the application in my Android device. It builds fine, but the application does not start. From the android debug console I get the following debug log:

--------- beginning of /dev/log/system

--------- beginning of /dev/log/main

I/Unity   ( 8510): splash_mode = 0 (integer)

I/Unity   ( 8510): useObb = False (bool)

I/Unity   ( 8510): onResume

D/Unity   ( 8510): SetWindow 0 0x7d5885c8

D/Unity   ( 8510): SetWindow 0 0x7d5885c8

I/Unity   ( 8510): windowFocusChanged: true

D/Unity   ( 8510): SystemInfo CPU = ARMv7 VFPv3 NEON, Cores = 8, Memory = 1917mb

D/Unity   ( 8510): SystemInfo ARM big.LITTLE configuration: 4 big (mask: 240), 4 little (mask: 15)

D/Unity   ( 8510): [SHA1] 0a9147f52655f460e76fee84f1bba2b3490c622c   28622252 bytes ~ lib/armeabi-v7a/libunity.so

D/Unity   ( 8510): [SHA1] ae08f27fce96373832b6f9d90b3f28952ee66625      25316 bytes ~ lib/armeabi-v7a/libmain.so

D/Unity   ( 8510): [SHA1] 2fa46dbe358313f35706645767a93fb733825491    3762548 bytes ~ lib/armeabi-v7a/libmono.so

D/Unity   ( 8510): [SHA1] 280b77618ebc7a76a1d01576f7708dd9bf80d8fd   32592092 bytes ~ lib/x86/libunity.so

D/Unity   ( 8510): [SHA1] bfe16f03ae5ca056dc7162ebb92356fba398b819       8120 bytes ~ lib/x86/libmain.so

D/Unity   ( 8510): [SHA1] dcc15a475feca0cf6d6b53d7928970dd9fd5c10e    3632348 bytes ~ lib/x86/libmono.so

D/Unity   ( 8510): [EGL] Attaching window :0x7d5885c8

D/Unity   ( 8510): Mono path[0] = '/mnt/asec/com.um.chemistryapp-1/pkg.apk/assets/bin/Data/Managed'

D/Unity   ( 8510): Mono config path = 'assets/bin/Data/Managed'

D/Unity   ( 8510): PlayerConnection initialized from /mnt/asec/com.um.chemistryapp-1/pkg.apk/assets/bin/Data (debug = 0)

D/Unity   ( 8510): PlayerConnection initialized network socket : 0.0.0.0 55048

D/Unity   ( 8510): PlayerConnection initialized unix socket : Unity-com.um.chemistryapp

D/Unity   ( 8510): Multi-casting "[IP] 172.22.76.182 [Port] 55048 [Flags] 2 [Guid] 759227169 [EditorId] 4294967295 [Version] 1048832 [Id] AndroidPlayer(RUIFU_Woxter_Zielo_ZX900@172.22.76.182) [Debug] 0" to [225.0.0.222:54997]...

D/Unity   ( 8510): Started listening to [0.0.0.0:55048]

Sometimes I do not get anything from log.

Using NMS.Stomp instead of NMS.activeMQ produces the same behaviour so I decided to try to not use NMS. I found a MQTT library for Unity and it works succesfully on the editor but I can not achieve to connect to server from Android device, you can see a detailed post of the MQTT issue here: Connecting Unity3d Android application to ActiveMQ broker using MQTT

Please can I have some help on succesfully subscribing to an ActiveMQ publisher? I do not have any restrictions more than doing from within a Unity3d application, and that it should run in android.

Thanks.