Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DBFC1187EE for ; Thu, 2 Jul 2015 09:34:42 +0000 (UTC) Received: (qmail 15702 invoked by uid 500); 2 Jul 2015 09:34:42 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 15654 invoked by uid 500); 2 Jul 2015 09:34:42 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 15643 invoked by uid 99); 2 Jul 2015 09:34:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2015 09:34:42 +0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of t.c.dewit@gmail.com does not designate 162.253.133.15 as permitted sender) Received: from [162.253.133.15] (HELO mbob.nabble.com) (162.253.133.15) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2015 09:32:27 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mbob.nabble.com (Postfix) with ESMTP id 9BF3C104AA7F for ; Thu, 2 Jul 2015 02:35:08 -0700 (PDT) Date: Thu, 2 Jul 2015 02:34:13 -0700 (MST) From: tcdewit To: users@camel.apache.org Message-ID: <1435829653693-5768796.post@n5.nabble.com> Subject: Custom processor methods not visible in JConsole MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, Part of my camel route consists of a JMS queue, being polled and its messages being stored in a db, depending on message type. The route is transacted, and therefore it's not possible to configure redeliveryDelay in the ActiveMQXAConnectionFactory bean, but i had to use a custom processor "redeliveryDelay" instead that checks the JMSXDeliveryCount in the header and introduces a delay depending on the retry count. I would like to have the possibility to configure/manage this processor and its methods through jconsole/jmx but am having some problems with it: - without using the annotations @ManagedResource, @ManagedAttribute i can see the processor mbean, but cannot see its methods - with annotations the processor mbean is not visible anymore (even if i "implement Service" like mentioned in the camel FAQ, or if i implement the deprecated ManagementAware). I also tried using only @ManagedResource or @ManagedAttribute separately... - when moving the processor to the recoverable camel:onException route (preferable since its only executed when needed) the mbean is not visible at all; even without annotations. Any ideas? regards, Tim Relevant part of route: #{request.headers['CamelHL7MessageType'] == 'ADT'} #{request.headers['CamelHL7MessageType'] == 'ORM'} java.sql.SQLException org.springframework.jdbc.CannotGetJdbcConnectionException false java.lang.Exception org.springframework.jdbc.UncategorizedSQLException true Processor code: import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.api.management.ManagedAttribute; import org.apache.camel.api.management.ManagedResource; @ManagedResource public class redeliveryDelay implements Processor { private long delay = 0; @ManagedAttribute public long getDelay() { return delay; } @ManagedAttribute public void setDelay(long delay) { this.delay = delay; } @Override public void process(Exchange exchange) throws Exception { String redeliveryCountAsString = exchange.getIn().getHeader("JMSXDeliveryCount", String.class); if(redeliveryCountAsString==null) { redeliveryCountAsString="1"; } int redeliveryCount = Integer.parseInt(redeliveryCountAsString); switch (redeliveryCount) { case 0: this.setDelay(0); break; case 1: case 2: case 3: this.setDelay(5000); break; // 3 x 5 seconds case 4: this.setDelay(60*1000); break; // 1 minute case 5: this.setDelay(5*60*1000); break; // 5 minutes case 6: this.setDelay(30*60*1000); break; // 30 minutes case 7: this.setDelay(60*60*1000); break; // 60 minutes default: this.setDelay(8*60*60*1000); break; // every 8 hours } Thread.sleep(this.getDelay()); } } -- View this message in context: http://camel.465427.n5.nabble.com/Custom-processor-methods-not-visible-in-JConsole-tp5768796.html Sent from the Camel - Users mailing list archive at Nabble.com.