Skip to content

Commit

Permalink
fix(jmx,camel): fix Operations tab crashes when used with Camel JBang
Browse files Browse the repository at this point in the history
Fix #670
  • Loading branch information
tadayosi committed Nov 16, 2023
1 parent 308ce3f commit 3f66dd3
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 3f66dd3

Please sign in to comment.