How to populate Query tab in Java

I’m struggling to understand how to get Queries in the server dashboard under the Query tab. I’m a total beginner.

I read Query Tab in the UI, but I couldn’t glance from the GO code how to do it in Java, and the documentation for Java is a bit… lean (for example to doesn’t indicate how to make a query strong, other than on the cli). I have configured my workflow interface with @QueryMethod, but they don’t show up under the tab. Is that how it is supposed to work though?

Note that I do have a worker running.

I believe in the latest version of Temporal and UI the query tab is populated automatically based on queries a workflow implements.

With @QueryMethod? Because that doesn’t seem to do the trick…

I think the fix for this wasn’t released yet. You can try using the snapshot build.

To use a snapshot build:

  • Add snapshot repository to your Gradle/Maven build file:
repositories {
    maven {
        url "https://plugins.gradle.org/m2/"
    }
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots/"
    }
    mavenCentral()
}
  • Use the snapshot dependency:
implementation group: 'io.temporal', name: 'temporal-sdk', version: '1.0.6-SNAPSHOT'

Actually, I just noticed this bug was solved in the 1.0.6 release from 5 days ago. Thanks for pointing me in the right direction.

1 Like