0

I can call the following URL to find out the state of a Camel route section...

http://localhost:8080/gateway047/jolokia/exec/org.apache.camel:context=VCM047,type=routes,name=%22VCM047_store_list_schedule%22/getState()

This will give

{
timestamp: 1425658189,
status: 200,
request: {
operation: "getState()",
mbean: "org.apache.camel:context=VCM047,name="VCM047_store_list_schedule",type=routes",
type: "exec"
},
value: "Started"
}

The route section is defined as...

<route id="VCM047_store_list_schedule">
      <!-- Fire every 8 hours -->
      <from uri="timer://storeListTimer?fixedRate=true&amp;period=28800000"/>

      <transform>
        <simple>{{WebStoresToProcess}}</simple>
      </transform>

      <to uri="direct:splitStores" />
    </route>

I want to be able to trigger this section for testing.

So if I could stop/start the section, it might tigger it.

Which leads me to try...

http://localhost:8080/gateway047/jolokia/exec/org.apache.camel:context=VCM047,type=routes,name=%22VCM047_store_list_schedule%22/stop()

But this never returns.

Can anyone offer some advice on how to stop / start a camel-section via Jolokia.

jeff porter
  • 6,560
  • 13
  • 65
  • 123

1 Answers1

1

The stop() operation on the Camel managedBean is a void operation, so you should not expect any return value. To find out what is the current status you can getState() again.

If you are having problems with the stopping itself (it hangs for example), you can always use a direct JMX client (like JVisualVM) to have a much better support for JMX operations. Unlike Jolokia (which is an HTTP wrapper for JMX) a standalone tool can give you much more support on discovering what operations you have available and eliminates certain complications you might encounter via HTTP.

Gergely Bacso
  • 14,243
  • 2
  • 44
  • 64