title: How do I use the celery (java version) in Kotlin
body: <p>I am trying to do a tiny poc (a add operation in a celery task) with Kotlin -&gt; celery -&gt; python.</p>
  <p>Python-&gt;celery-&gt;Python is ok. But with <a href="https://github.com/crabhi/celery-java" rel="nofollow noreferrer">https://github.com/crabhi/celery-java</a> and this &quot;wrong&quot; code:</p>
  <pre class="lang-kotlin prettyprint-override"><code>package poc_kotlin_celery                                        
                                                                   
  import com.geneea.celery.*                                       
                                                                   
  fun main() {                                                     
     val client: Celery = Celery.builder()                         
          .brokerUri(&quot;amqp://localhost/%2F&quot;)                       
          .backendUri(&quot;rpc://localhost/%2F&quot;)                       
          .build();                                                
                                                                   
     val args = arrayOf(1, 2)                                      
     val result: AsyncResult&lt;Int&gt; = client.submit(&quot;task.add&quot;, args)
     val suma: Int = result.get() as Int                           
                                                                   
                                                                   
     println(suma as Int);                                         
  }                                                                
  </code></pre>
  <p>I can not fix the compilation errors:</p>
  <pre class="lang-sh prettyprint-override"><code>$ gradle run
  
  &gt; Task :app:compileKotlin FAILED
  e: /home/miguel/code/poc_kotlin_celery/app/src/main/kotlin/poc_kotlin_celery/App.kt: (15, 16): Unresolved reference: AsyncResult
  e: /home/miguel/code/poc_kotlin_celery/app/src/main/kotlin/poc_kotlin_celery/App.kt: (15, 42): Not enough information to infer type variable R
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':app:compileKotlin'.
  &gt; Compilation error. See log for more details
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  
  * Get more help at https://help.gradle.org
  
  BUILD FAILED in 730ms
  1 actionable task: 1 executed
  
  </code></pre>