You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by contactreji <co...@gmail.com> on 2015/11/09 08:43:33 UTC

Camel Metrics over Spring metrics

*Hello Folks

I am trying to emit metrics from my camel application. I have my camel
context defined as follows*

<?xml version="1.0" encoding="UTF-8"?>


<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:ctx="http://www.springframework.org/schema/context"
	   xmlns:metrics="http://www.ryantenney.com/schema/metrics"
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
       http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
       http://www.ryantenney.com/schema/metrics
       http://www.ryantenney.com/schema/metrics/metrics-3.0.xsd">

	<ctx:property-placeholder location="classpath:appConfigs.groovy" />
    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <propertyPlaceholder id="placeholder"
location="classpath:appConfigs.groovy" />
        <routeBuilder ref="RoutesWithProcessors"/>
		<routeBuilder ref="VMMVendorIntegrationRoute"/>
	</camelContext>

	
	<bean id="RoutesWithProcessors"
class="com.groovy.routes.RoutesWithProcessors"/>
	<bean id="VMMVendorIntegrationRoute"
class="com.groovy.routes.VMMVendorIntegrationRoute"/>

    
	<bean id="CustomLogic" class="com.groovy.processors.CustomLogicImpl"/>

    
	<bean id="metricsRoutePolicyFactory"
class="org.apache.camel.component.metrics.routepolicy.MetricsRoutePolicyFactory">
        <property name="metricsRegistry" ref="metrics"/>
    </bean>

    
    
    <metrics:metric-registry id="metrics" />
    <metrics:annotation-driven metric-registry="metrics" />
    <metrics:reporter type="console" metric-registry="metrics" period="15s"
/>

    <metrics:register metric-registry="metrics">
        <bean metrics:name="jvm.gc"
class="com.codahale.metrics.jvm.GarbageCollectorMetricSet" />
        <bean metrics:name="jvm.memory"
class="com.codahale.metrics.jvm.MemoryUsageGaugeSet" />
        <bean metrics:name="jvm.thread-states"
class="com.codahale.metrics.jvm.ThreadStatesGaugeSet" />
        <bean metrics:name="jvm.fd.usage"
class="com.codahale.metrics.jvm.FileDescriptorRatioGauge" />
    </metrics:register>

</beans>

*And I also have my camel route as follows*

package com.groovy.routes

import com.codahale.metrics.annotation.Counted
import com.codahale.metrics.annotation.ExceptionMetered
import com.codahale.metrics.annotation.Gauge
import com.codahale.metrics.annotation.Metered
import com.codahale.metrics.annotation.Timed
import com.ryantenney.metrics.spring.config.annotation.EnableMetrics
import
com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter
import org.apache.camel.builder.RouteBuilder
import org.springframework.context.annotation.Configuration

import java.util.Properties
import java.io.File
/**
 * Created by Z001NLH on 11/5/2015.
 */

@Configuration
@EnableMetrics
class VMMVendorIntegrationRoute extends RouteBuilder{


    URL url =
VMMVendorIntegrationRoute.class.getClassLoader().getResource("appConfigs.groovy");
    def config = new ConfigSlurper().parse(url)

/*    @Timed
    @Metered
    @ExceptionMetered*/
    @Counted
    void configure() throws Exception {
       
       
from("file:"+config.batchDownloadedDumpFile+"?fileName="+config.downloadedDataDumpFileName).routeId("VmmVendor-3").pollEnrich("file:"+config.batchDownloadedDumpFile+"?fileName="+config.downloadedDataDumpFileName).split().tokenizeXML("vendor").streaming().multicast().to("seda:TransformFile1","seda:TransformFile2").end()
       
from("seda:TransformFile1").routeId("VmmVendor-4").to("xquery:xquery/Vendor_File1.xq").setHeader("CamelFileName",simple("exchangeId")).to("file:"+config.outputPath1).to("metrics:counter:fileTransformed1").end();
       
from("seda:TransformFile2").routeId("VmmVendor-5").to("xquery:xquery/Vendor_File2.xq").setHeader("CamelFileName",simple("exchangeId")).to("file:"+config.outputPath2).to("metrics:counter:fileTransformed2").end()
    }
}


*I have 2 Questions here - 

1. The 15s metrics reporter is configured which prints metrics over the
console. It prints logs as shown below.
2. The camel-metric component used inside the above routebuilder but
statistics from those are printed every 1 minute only. Is there a way I can
add the feed from this metrics ( metrics:counter:fileTransformed2 and
metrics:counter:fileTransformed1) also in my above 15s reporter. Or can I
use the metric registry declared in my camel-context file
<metrics:metric-registry id="metrics" /> to process the values from the
metric components in the route above?*


Booting up camel routes...
[main] INFO org.apache.camel.main.MainSupport - Apache Camel 2.15.1 starting
[main] INFO org.apache.camel.core.xml.AbstractCamelContextFactoryBean -
Using custom RoutePolicyFactory with id: metricsRoutePolicyFactory and
implementation:
org.apache.camel.component.metrics.routepolicy.MetricsRoutePolicyFactory@62435e70
[main] INFO org.apache.camel.spring.SpringCamelContext - Apache Camel 2.15.1
(CamelContext: camel-1) is starting
[main] INFO org.apache.camel.management.ManagedManagementStrategy - JMX is
enabled
[main] INFO org.apache.camel.impl.converter.DefaultTypeConverter - Loaded
204 type converters
[main] INFO org.apache.camel.component.seda.SedaEndpoint - Endpoint
Endpoint[seda://TransformFile1] is using shared queue: seda://TransformFile1
with size: 2147483647
[main] INFO org.apache.camel.component.seda.SedaEndpoint - Endpoint
Endpoint[seda://TransformFile2] is using shared queue: seda://TransformFile2
with size: 2147483647
[main] INFO org.apache.camel.component.metrics.MetricsComponent - Creating
new default MetricRegistry
[main] INFO org.apache.camel.spring.SpringCamelContext -
AllowUseOriginalMessage is enabled. If access to the original message is not
needed, then its recommended to turn this option off as it may improve
performance.
[main] INFO org.apache.camel.spring.SpringCamelContext - StreamCaching is
not in use. If using streams then its recommended to enable stream caching.
See more details at http://camel.apache.org/stream-caching.html
[main] INFO org.apache.camel.spring.SpringCamelContext - Route:
ProcessorRoute-1 started and consuming from:
Endpoint[file://C:%5CUsers%5CZ001NLH%5CDesktop%5Cin2]
[main] INFO org.apache.camel.spring.SpringCamelContext - Route:
CamelSimple-1 started and consuming from:
Endpoint[file://C:%5CUsers%5CZ001NLH%5CDesktop%5Cin3]
[main] INFO org.apache.camel.spring.SpringCamelContext - Route: VmmVendor-3
started and consuming from:
Endpoint[file://C:%5CUsers%5CZ001NLH%5CDesktop%5Cvmmadapters%5Cout?fileName=VMM_Vendor_Full_Feed.xml]
[main] INFO org.apache.camel.spring.SpringCamelContext - Route: VmmVendor-4
started and consuming from: Endpoint[seda://TransformFile1]
[main] INFO org.apache.camel.spring.SpringCamelContext - Route: VmmVendor-5
started and consuming from: Endpoint[seda://TransformFile2]
[main] INFO org.apache.camel.spring.SpringCamelContext - Total 5 routes, of
which 5 is started.
[main] INFO org.apache.camel.spring.SpringCamelContext - Apache Camel 2.15.1
(CamelContext: camel-1) started in 0.928 seconds
11/9/15 1:05:58 PM
=============================================================

-- Gauges
----------------------------------------------------------------------
jvm.fd.usage
             value = NaN
jvm.gc.PS-MarkSweep.count
             value = 1
jvm.gc.PS-MarkSweep.time
             value = 96
jvm.gc.PS-Scavenge.count
             value = 7
jvm.gc.PS-Scavenge.time
             value = 73
jvm.memory.heap.committed
             value = 129499136
jvm.memory.heap.init
             value = 134217728
jvm.memory.heap.max
             value = 1888485376
jvm.memory.heap.usage
             value = 0.017718559235483326
jvm.memory.heap.used
             value = 33461240
jvm.memory.non-heap.committed
             value = 50593792
jvm.memory.non-heap.init
             value = 2555904
jvm.memory.non-heap.max
             value = -1
jvm.memory.non-heap.usage
             value = -4.9446632E7
jvm.memory.non-heap.used
             value = 49449312
jvm.memory.pools.Code-Cache.usage
             value = 0.048019154866536455
jvm.memory.pools.Compressed-Class-Space.usage
             value = 0.0038251951336860657
jvm.memory.pools.Metaspace.usage
             value = 0.9797299653867036
jvm.memory.pools.PS-Eden-Space.usage
             value = 0.013953747511823515
jvm.memory.pools.PS-Old-Gen.usage
             value = 0.009121000457921795
jvm.memory.pools.PS-Survivor-Space.usage
             value = 0.9984603155226934
jvm.memory.total.committed
             value = 180092928
jvm.memory.total.init
             value = 136773632
jvm.memory.total.max
             value = 1888485375
jvm.memory.total.used
             value = 82949256
jvm.thread-states.blocked.count
             value = 0
jvm.thread-states.count
             value = 13
jvm.thread-states.daemon.count
             value = 12
jvm.thread-states.deadlocks
             value = []
jvm.thread-states.new.count
             value = 0
jvm.thread-states.runnable.count
             value = 4
jvm.thread-states.terminated.count
             value = 0
jvm.thread-states.timed_waiting.count
             value = 6
jvm.thread-states.waiting.count
             value = 3

-- Counters
--------------------------------------------------------------------
com.groovy.routes.VMMVendorIntegrationRoute.configure
             count = 0

-- Timers
----------------------------------------------------------------------
camel-1:CamelSimple-1.responses
             count = 0
         mean rate = 0.00 calls/second
     1-minute rate = 0.00 calls/second
     5-minute rate = 0.00 calls/second
    15-minute rate = 0.00 calls/second
               min = 0.00 milliseconds
               max = 0.00 milliseconds
              mean = 0.00 milliseconds
            stddev = 0.00 milliseconds
            median = 0.00 milliseconds
              75% <= 0.00 milliseconds
              95% <= 0.00 milliseconds
              98% <= 0.00 milliseconds
              99% <= 0.00 milliseconds
            99.9% <= 0.00 milliseconds
camel-1:ProcessorRoute-1.responses
             count = 0
         mean rate = 0.00 calls/second
     1-minute rate = 0.00 calls/second
     5-minute rate = 0.00 calls/second
    15-minute rate = 0.00 calls/second
               min = 0.00 milliseconds
               max = 0.00 milliseconds
              mean = 0.00 milliseconds
            stddev = 0.00 milliseconds
            median = 0.00 milliseconds
              75% <= 0.00 milliseconds
              95% <= 0.00 milliseconds
              98% <= 0.00 milliseconds
              99% <= 0.00 milliseconds
            99.9% <= 0.00 milliseconds
camel-1:VmmVendor-3.responses
             count = 0
         mean rate = 0.00 calls/second
     1-minute rate = 0.00 calls/second
     5-minute rate = 0.00 calls/second
    15-minute rate = 0.00 calls/second
               min = 0.00 milliseconds
               max = 0.00 milliseconds
              mean = 0.00 milliseconds
            stddev = 0.00 milliseconds
            median = 0.00 milliseconds
              75% <= 0.00 milliseconds
              95% <= 0.00 milliseconds
              98% <= 0.00 milliseconds
              99% <= 0.00 milliseconds
            99.9% <= 0.00 milliseconds
camel-1:VmmVendor-4.responses
             count = 0
         mean rate = 0.00 calls/second
     1-minute rate = 0.00 calls/second
     5-minute rate = 0.00 calls/second
    15-minute rate = 0.00 calls/second
               min = 0.00 milliseconds
               max = 0.00 milliseconds
              mean = 0.00 milliseconds
            stddev = 0.00 milliseconds
            median = 0.00 milliseconds
              75% <= 0.00 milliseconds
              95% <= 0.00 milliseconds
              98% <= 0.00 milliseconds
              99% <= 0.00 milliseconds
            99.9% <= 0.00 milliseconds
camel-1:VmmVendor-5.responses
             count = 0
         mean rate = 0.00 calls/second
     1-minute rate = 0.00 calls/second
     5-minute rate = 0.00 calls/second
    15-minute rate = 0.00 calls/second
               min = 0.00 milliseconds
               max = 0.00 milliseconds
              mean = 0.00 milliseconds
            stddev = 0.00 milliseconds
            median = 0.00 milliseconds
              75% <= 0.00 milliseconds
              95% <= 0.00 milliseconds
              98% <= 0.00 milliseconds
              99% <= 0.00 milliseconds
            99.9% <= 0.00 milliseconds




-----
Reji Mathews
Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel & Jboss Fuse ESB | Mule ESB )
LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
Twitter - reji_mathews
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Metrics-over-Spring-metrics-tp5773518.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Metrics over Spring metrics

Posted by contactreji <co...@gmail.com>.
Hi Claus

Thanks for that clue. I tried something like follows as I see the method
dumpStatisticsAsJson() is already implemented in
org.apache.camel.component.metrics.routepolicy.MetricsRegistryService class.

Hope this is a sane way of trying to get something out from the method. 

*<camelContext xmlns="http://camel.apache.org/schema/spring"
id="myCamelContext">
        <propertyPlaceholder id="placeholder"
location="classpath:appConfigs.groovy" />
		<routeBuilder ref="VMMVendorIntegrationRoute"/>

        <route id="metrics-dump">
            <from uri="timer://foo?fixedRate=true&amp;period=15000"/>
            <bean ref="metricsRegistryService"
method="dumpStatisticsAsJson"/>
            <log message="JSON Dump - ${body}"/>
        </route>

	</camelContext>

    <bean id="metricsRegistryService"
class="org.apache.camel.component.metrics.routepolicy.MetricsRegistryService">
        <property name="metricsRegistry" ref="metricRegistry"/>
        <property name="prettyPrint" value="true"/>
        <property name="jmxDomain" value="org.apache.camel.metrics"/>
        <property name="useJmx" value="true"/>
    </bean>*

However, I get exception 
[Camel (myCamelContext) thread #3 - timer://foo] WARN
org.apache.camel.component.timer.TimerConsumer - Error processing exchange.
Exchange[Message: [Body is null]]. Caused by:
[java.lang.NullPointerException - null]
java.lang.NullPointerException

*Looks like this method doesn't take any arguments. Why should this
exception show up? Is there a work around for this.

I even tried setting some dummy value in exchange Body.. Now I get a
different exception as follows. Any clue how I can make a call to the
method?
*
java.lang.NullPointerException
	at
org.apache.camel.component.metrics.routepolicy.MetricsRegistryService.dumpStatisticsAsJson(MetricsRegistryService.java:158)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:408)
	at
org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:279)
	at
org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:252)
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:171)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
	at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
	at
org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:165)
	at
org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:73)
	at java.util.TimerThread.mainLoop(Timer.java:555)
	at java.util.TimerThread.run(Timer.java:505)
[Camel (myCamelContext) thread #3 - timer://foo] WARN
org.apache.camel.component.timer.TimerConsumer - Error processing exchange.
Exchange[Message: testValue]. Caused by: [java.lang.NullPointerException -
null]
java.lang.NullPointerException
	at
org.apache.camel.component.metrics.routepolicy.MetricsRegistryService.dumpStatisticsAsJson(MetricsRegistryService.java:158)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:408)
	at
org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:279)
	at
org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:252)
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:171)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)



-----
Reji Mathews
Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel & Jboss Fuse ESB | Mule ESB )
LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
Twitter - reji_mathews
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Metrics-over-Spring-metrics-tp5773518p5773527.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Metrics over Spring metrics

Posted by Claus Ibsen <cl...@gmail.com>.
The camel-metrics component has an jmx api to dump all as json.
https://github.com/apache/camel/blob/master/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/routepolicy/MetricsRegistryMBean.java



On Mon, Nov 9, 2015 at 11:23 AM, contactreji <co...@gmail.com> wrote:
> Hey
>
> I think I got it to work with following configs in camel-context.
>
> But I have one more question here. Is there a way to get the complete data
> as json dump by configuring the metrics reporter in this camel-context file?
>
> *<?xml version="1.0" encoding="UTF-8"?>
>
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>            xmlns:ctx="http://www.springframework.org/schema/context"
>            xmlns:metrics="http://www.ryantenney.com/schema/metrics"
>         xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
>        http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
>        http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context.xsd
>        http://www.ryantenney.com/schema/metrics
>        http://www.ryantenney.com/schema/metrics/metrics-3.0.xsd">
>
>         <ctx:property-placeholder location="classpath:appConfigs.groovy" />
>     <camelContext xmlns="http://camel.apache.org/schema/spring">
>         <propertyPlaceholder id="placeholder"
> location="classpath:appConfigs.groovy" />
>         <routeBuilder ref="RoutesWithProcessors"/>
>                 <routeBuilder ref="VMMVendorIntegrationRoute"/>
>         </camelContext>
>
>
>         <bean id="RoutesWithProcessors"
> class="com.groovy.routes.RoutesWithProcessors"/>
>         <bean id="VMMVendorIntegrationRoute"
> class="com.groovy.routes.VMMVendorIntegrationRoute"/>
>
>         <bean id="CustomLogic" class="com.groovy.processors.CustomLogicImpl"/>
>
>         <bean id="metricsRoutePolicyFactory"
> class="org.apache.camel.component.metrics.routepolicy.MetricsRoutePolicyFactory">
>         <property name="metricsRegistry" ref="metricRegistry"/>
>         <property name="prettyPrint" value="false"/>
>         <property name="jmxDomain" value="org.apache.camel.metrics"/>
>         <property name="useJmx" value="true"/>
>     </bean>
>
>     <metrics:metric-registry id="metricRegistry"/>
>     <metrics:annotation-driven metric-registry="metricRegistry" />
>     <metrics:reporter type="console" metric-registry="metricRegistry"
> period="15s" />
>     <metrics:reporter type="slf4j" metric-registry="metricRegistry"
> period="100ms" logger="com.foo.bar" marker="foobar" rate-unit="MINUTES"
> duration-unit="MICROSECONDS" />
>
>     <metrics:register metric-registry="metricRegistry">
>         <bean metrics:name="jvm.gc"
> class="com.codahale.metrics.jvm.GarbageCollectorMetricSet" />
>         <bean metrics:name="jvm.memory"
> class="com.codahale.metrics.jvm.MemoryUsageGaugeSet" />
>         <bean metrics:name="jvm.thread-states"
> class="com.codahale.metrics.jvm.ThreadStatesGaugeSet" />
>         <bean metrics:name="jvm.fd.usage"
> class="com.codahale.metrics.jvm.FileDescriptorRatioGauge" />
>     </metrics:register>
> </beans>*
>
>
>
> -----
> Reji Mathews
> Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel & Jboss Fuse ESB | Mule ESB )
> LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
> Twitter - reji_mathews
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Metrics-over-Spring-metrics-tp5773518p5773523.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Camel Metrics over Spring metrics

Posted by contactreji <co...@gmail.com>.
Hey 

I think I got it to work with following configs in camel-context.

But I have one more question here. Is there a way to get the complete data
as json dump by configuring the metrics reporter in this camel-context file?

*<?xml version="1.0" encoding="UTF-8"?>


<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:ctx="http://www.springframework.org/schema/context"
	   xmlns:metrics="http://www.ryantenney.com/schema/metrics"
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
       http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
       http://www.ryantenney.com/schema/metrics
       http://www.ryantenney.com/schema/metrics/metrics-3.0.xsd">

	<ctx:property-placeholder location="classpath:appConfigs.groovy" />
    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <propertyPlaceholder id="placeholder"
location="classpath:appConfigs.groovy" />
        <routeBuilder ref="RoutesWithProcessors"/>
		<routeBuilder ref="VMMVendorIntegrationRoute"/>
	</camelContext>

	
	<bean id="RoutesWithProcessors"
class="com.groovy.routes.RoutesWithProcessors"/>
	<bean id="VMMVendorIntegrationRoute"
class="com.groovy.routes.VMMVendorIntegrationRoute"/>
    
	<bean id="CustomLogic" class="com.groovy.processors.CustomLogicImpl"/>
    
	<bean id="metricsRoutePolicyFactory"
class="org.apache.camel.component.metrics.routepolicy.MetricsRoutePolicyFactory">
        <property name="metricsRegistry" ref="metricRegistry"/>
        <property name="prettyPrint" value="false"/>
        <property name="jmxDomain" value="org.apache.camel.metrics"/>
        <property name="useJmx" value="true"/>
    </bean>
    
    <metrics:metric-registry id="metricRegistry"/>
    <metrics:annotation-driven metric-registry="metricRegistry" />
    <metrics:reporter type="console" metric-registry="metricRegistry"
period="15s" />
    <metrics:reporter type="slf4j" metric-registry="metricRegistry"
period="100ms" logger="com.foo.bar" marker="foobar" rate-unit="MINUTES"
duration-unit="MICROSECONDS" />
   
    <metrics:register metric-registry="metricRegistry">
        <bean metrics:name="jvm.gc"
class="com.codahale.metrics.jvm.GarbageCollectorMetricSet" />
        <bean metrics:name="jvm.memory"
class="com.codahale.metrics.jvm.MemoryUsageGaugeSet" />
        <bean metrics:name="jvm.thread-states"
class="com.codahale.metrics.jvm.ThreadStatesGaugeSet" />
        <bean metrics:name="jvm.fd.usage"
class="com.codahale.metrics.jvm.FileDescriptorRatioGauge" />
    </metrics:register>
</beans>*



-----
Reji Mathews
Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel & Jboss Fuse ESB | Mule ESB )
LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
Twitter - reji_mathews
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Metrics-over-Spring-metrics-tp5773518p5773523.html
Sent from the Camel - Users mailing list archive at Nabble.com.