Hi
I have a similar problem. I have a queue listener (using DMLC) that is listening to an ActiveMQ(actually FuseMQ 5.3.0.4). Please suggest how can I get my bundle detected by AMS.
I am using AMS 2.0, community version and dm-server-1.0.2.SR02 (this one comes with the STS installer itself). I have replaced all the bundles with their instrumented versions in the dm-server-1.0.2.SR02\repository\bundles\ext folder. Is that all that we need to or am I missing anything? Below is my code for clarity:
Spring config file:
Code:
<?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:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schem...-beans-2.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL">
<value>tcp://localhost:61616</value>
</property>
</bean>
<!-- JMX -->
<context:mbean-export />
<bean id="testq" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg index="0" value="testq" />
</bean>
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory"/>
</bean>
<bean class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="connectionFactory" />
<property name="destination" ref="testq" />
<property name="messageListener" ref="purePojoMdp" />
<property name="concurrentConsumers" value="5" />
<property name="maxConcurrentConsumers" value="15" />
</bean>
<bean id="receiver" class="JMSReceiver" />
<bean id="purePojoMdp" class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
<property name="delegate" ref="receiver" />
<property name="defaultListenerMethod" value="processMessages" />
</bean>
</beans>
JMSReceiver.java
Code:
import java.util.HashMap;
import org.springframework.jmx.export.annotation.ManagedOperation;
import org.springframework.jmx.export.annotation.ManagedResource;
import com.springsource.management.adapter.jmx.ManagedMetric;
import com.springsource.management.agent.inventory.resource.metric.MetricCategory;
import com.springsource.management.agent.inventory.resource.metric.MetricType;
@ManagedResource(objectName = "spring.application:application=ams.test,type=MessageListener,name=JMSListener")
public class JMSReceiver {
public JMSReceiver() {}
@ManagedOperation
public void processMessages(HashMap message) {
try {
String name = (String)message.get("name");
Thread.sleep(7500);
System.out.println("Received Message:" + name);
}
catch(Exception e) {
e.printStackTrace();
}
}
}
MANIFEST.MF
Code:
Manifest-Version: 1.0
Bundle-Version: 1.0.0
Tool: Bundlor 1.0.0.BUILD-20090616142719
Bundle-Name: ReceiverBundle
Bundle-ManifestVersion: 2
Import-Package: com.springsource.management.adapter.jmx,org.apache.act
ivemq,org.apache.activemq.command,org.springframework.jms.core,org.sp
ringframework.jms.listener,org.springframework.jms.listener.adapter,o
rg.springframework.jmx.export.annotation
Bundle-SymbolicName: ReceiverBundle
Import-Bundle: com.springsource.management.agent.inventory;version="[2.5.6.SEC01,2.5.6.SEC01]",
com.springsource.management.agent.monitoring;version="[2.5.6.SEC01,2.5.6.SEC01]"
.classpath file
Code:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="com.springsource.server.ide.jdt.core.MANIFEST_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Although I am able to see the "ActiveMQ 4.0 testq localhost Queue" and the "SpringSource dm Server 1.0" in AMS console, these do not show any metrics for the things that I am trying to monitor i.e. my MDP application and the testq. Please advise how can I monitor these. Do we need to get the enterprise versions of the softwares or am I missing anything?