I am trying to get the Android SDK to point to Snowplow Micro, but having no luck.
Following the guide here:
I am setting up using the following:
export MICRO_IGLU_API_KEY=<mykey>
export MICRO_IGLU_REGISTRY_URL=<my_url>
docker run -p 9090:9090 \
-e MICRO_IGLU_REGISTRY_URL \
-e MICRO_IGLU_API_KEY \
snowplow/snowplow-micro:2.1.0
Which runs fine and I can see the UI (e.g. http://localhost:9090/micro/ui)
My Snowplow SDK setup is as follows (note: I have tried with http and https)
private fun initSnowPlow() {
val emitter =
Emitter.EmitterBuilder("localhost:9090", applicationContext)
.security(RequestSecurity.HTTPS)
.build()
val subject =
Subject.SubjectBuilder()
.context(appContext)
.build()
Tracker.init(
Tracker.TrackerBuilder(
emitter,
getString(R.string.app_name),
appContext?.getAppVersion(),
appContext
)
.level(DEBUG)
.lifecycleEvents(true)
.base64(false)
.subject(subject)
.sessionContext(true)
.mobileContext(true)
.geoLocationContext(false)
.applicationCrash(true)
.sessionCheckInterval(10)
.foregroundTimeout(300)
.backgroundTimeout(120)
.build()
)
}
I can see in the App logs (logcat) I am getting the following errors
pool-32-thread-2|Ensure collector path is valid: https://localhost:9090/com.snowplowanalytics.snowplow/tp2
pool-32-thread-2|Emitter loop stopping: failures.
pool-32-thread-1|Added event to database: 8
pool-32-thread-1|Tracker connection online: true
pool-32-thread-1|Request Futures: 1
pool-32-thread-2|Request sending failed: java.net.ConnectException: Failed to connect to localhost/127.0.0.1:9090
pool-32-thread-1|Request sending failed but we will retry later.
Does anyone know what may be going on here?