[ 
https://issues.apache.org/jira/browse/AMQ-9447?focusedWorklogId=912387&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-912387
 ]

ASF GitHub Bot logged work on AMQ-9447:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/Mar/24 17:00
            Start Date: 31/Mar/24 17:00
    Worklog Time Spent: 10m 
      Work Description: AM-19 opened a new pull request, #1192:
URL: https://github.com/apache/activemq/pull/1192

   Hello Team,
   
   With Regards to Transport Connector, Have added a check based on the 
connection count.
   
   Also in the ticket, With regards to JDBC Persistence Check, We may need to 
have JDBC persistence associated classes in activemq-broker,jar, Post that we 
can have a logic something like following:
   
   `
           if (brokerService != null && brokerService.getPersistenceAdapter() 
!= null 
                        && brokerService.getPersistenceAdapter() instanceof 
JDBCPersistenceAdapter ) {
                JDBCPersistenceAdapter jdbcAdapter = (JDBCPersistenceAdapter) 
brokerService.getPersistenceAdapter();
                        String message = "Issue with Persistence layer";
               try {
                ResultSet rs = null;
                Statement stmt = 
jdbcAdapter.getDataSource().getConnection().createStatement();
                rs = stmt.executeQuery("SELECT 1");
                                String message = 
                if(rs.next())
                                        if(rs.getInt(1)!=1)
                                                answer.add(new 
HealthStatus("org.apache.activemq.store.jdbc.JDBCPersistenceAdapterIssue", 
"ERROR", message, jdbcAdapter.toString()));
               } catch(Exception e) {
                answer.add(new 
HealthStatus("org.apache.activemq.store.jdbc.JDBCPersistenceAdapterIssue", 
"ERROR", message, jdbcAdapter.toString()));
               }            
           }
   `
   
   Ive Tested the above and it works as expected. But again that would require 
whole jdbc persistence adapter code.




Issue Time Tracking
-------------------

            Worklog Id:     (was: 912387)
    Remaining Estimate: 0h
            Time Spent: 10m

> ActiveMQ Jolokia health service returns "good" even when persistence or 
> transports are failing
> ----------------------------------------------------------------------------------------------
>
>                 Key: AMQ-9447
>                 URL: https://issues.apache.org/jira/browse/AMQ-9447
>             Project: ActiveMQ Classic
>          Issue Type: Improvement
>          Components: Broker, JMX
>    Affects Versions: 5.18.3
>            Reporter: Ephemeris Lappis
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The Jolokia health service only considers the BrokerService status, it
> doesn't check all layers (like persistent store or transports).
> The CurrentStatus should not be "Good" if some underlying service is failing. 
> For example, with a JDBC persistence adapter, if the DB is not reachable, the 
> broker should not be considered as OK.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to