> For the complete documentation index, see [llms.txt](https://danhnhan-phung.gitbook.io/dnpi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://danhnhan-phung.gitbook.io/dnpi/springboot/migrate-from-rxjava-to-kotlin-coroutine-and-flows.md).

# Migrate from RxJava to Kotlin Coroutine and Flows

## First things first

{% hint style="info" %}
Setup and add required dependencies in your `gradle` or `pom` file:

<https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core>
{% endhint %}

## Problems with Retrofit2

{% hint style="warning" %}
If you are using an older version of Retrofit than `2.6.0` then you have to add the Kotlin Coroutine Adapter: <https://github.com/JakeWharton/retrofit2-kotlin-coroutines-adapter>&#x20;
{% endhint %}
