Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Jolokia Java Client - ReadRequest optional #173

@davsclaus

Description

@davsclaus

Hi

Jolokia version used: 1.2.3

I coud not find in the reference manual or java doc whether the java client supports optional reads. And by that I mean, a ReadRequest where the mbean may not exists. And if the mbean does not exists I just want a response back with an indicator that the mbean didnt exists.

Today I had to add a try .. catch hack, or I would need to do a list call first to see if the mbean is there, and then etc. But I would love if there was a read optional. Then I can use that as well in a List call so I can do a bulk operation.

For an example see the source code of Apache Camel where we have a jolokia command module

I have these 3 mbeans I need to get information from
https://github.com/apache/camel/blob/master/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/DefaultJolokiaCamelController.java#L117

And then this 4th mbean is optional, so I need to do a separate call to handle if it does not exists
https://github.com/apache/camel/blob/master/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/DefaultJolokiaCamelController.java#L148

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions