title: What's the best way to debug RxJava problems with not received messages
body: <p>I've an Android app with multiple <strong>observers of type A</strong> that subscribe with several <strong>Observables of type B</strong>. The subscription is done in IO Scheduler and the observation on the Android main thread.</p>
  
  <p>The problem that I've is that <strong>randomlly</strong> after some work one message emitted by B is never received in A and after some hours of debbuging I can't find the cause.</p>
  
  <p>Relevant code <strong>when the problem happens</strong>:</p>
  
  <p>"NEXT1" and "NEXT2" are printed but "RECEIVED","ERROR", COMPLETED aren't.</p>
  
  <pre><code>            //The subscription
              B.getMessate()
              .subscribeOn(Schedulers.io())
              .observeOn(AndroidSchedulers.mainThread())
              .subscribe(A);
  
              //B
              Observable&lt;msg&gt; getMessage() {
                   return Observable.create(new Observable.OnSubscribe&lt;msg&gt;() {    
                        public void call(Subscriber&lt;? super msg&gt; subscriber) {
                           ...
                           subscriber.onNext(msg)
                           println("NEXT1")
                        }
                   }).doOnNext({ (o) -&gt; println("NEXT2")});
              }
  
  
  
              //A 
              onNext(msg) {
                    //Never called when problem happens
                    println("RECEIVED")
              }
              onError(msg) {
                    //Never called when problem happens
                    println("ERROR")
              }
              onError(msg) {
                    //Never called when problem happens
                    println("COMPLETED")
              }
  </code></pre>
  
  <p>Anyone has some clue? or any recommendation for debugging that?</p>
  
  <p>What I've checked:</p>
  
  <ul>
  <li>I've paused the app and checked that all threads to see if one is locked. And aparentlly all working threads are parked and main thread is waiting messages in android message queue.</li>
  <li>Observers never call unsubscribe()</li>
  </ul>