Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jmx,camel): fix Operations tab crashes when used with Camel JBang #671

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/hawtio/src/plugins/shared/jolokia-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export enum JolokiaListMethod {
*/
const OPTIMISED_JOLOKIA_LIST_MBEAN = 'hawtio:type=security,name=RBACRegistry'

const OPTIMISED_JOLOKIA_LIST_MAX_DEPTH = 9
const JOLOKIA_LIST_MAX_DEPTH = 9

export type OptimisedListResponse = {
cache: OptimisedMBeanInfoCache
Expand Down Expand Up @@ -461,6 +461,9 @@ class JolokiaService implements IJolokiaService {
ajaxError?.(xhr, text, error)
reject(error)
}
// Overwrite max depth as listing MBeans requires some constant depth to work
// See: https://github.com/hawtio/hawtio-next/issues/670
options.maxDepth = JOLOKIA_LIST_MAX_DEPTH
switch (method) {
case JolokiaListMethod.OPTIMISED: {
log.debug('Invoke Jolokia list MBean in optimised mode:', paths)
Expand All @@ -478,9 +481,6 @@ class JolokiaService implements IJolokiaService {
},
options as BaseRequestOptions,
)
// Overwrite max depth as listing MBeans requires some constant depth to work
// TODO: Is this needed?
execOptions.maxDepth = OPTIMISED_JOLOKIA_LIST_MAX_DEPTH
if (paths.length === 0) {
jolokia.execute(mbean, 'list()', execOptions)
} else if (paths.length === 1) {
Expand Down
Loading