-
1. How to overwrite the Activation Config for an MDB in the Deployment Descriptor?
jaikiran Apr 6, 2011 3:33 AM (in response to laures)What does the ejb-jar.xml and the MDB code look like? Are you sure you are using the same ejb-name in the message-driven element as the name that you have used for you annotated bean?
-
2. Re: How to overwrite the Activation Config for an MDB in the Deployment Descriptor?
laures Apr 6, 2011 4:01 AM (in response to jaikiran)Annotations for the MDB class:
@MessageDriven(name = "HardwareTrackingConsumer",activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "personal.laures.testing") }) @ResourceAdapter("activemq-jms.rar")
ejb-jar.xml :
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" version="3.1"> <enterprise-beans> <message-driven> <ejb-name>HardwareTrackingConsumer</ejb-name> <ejb-class>test.AdvancedTrackingConsumer</ejb-class> <activation-config> <activation-config-property> <activation-config-property-name>destinationType</activation-config-property-name> <activation-config-property-value>javax.jms.Queue</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>destination</activation-config-property-name> <activation-config-property-value>personal.laures.hwtracking</activation-config-property-value> </activation-config-property> </activation-config> </message-driven> </enterprise-beans> </ejb-jar>
The javadoc for @MessageDriven sais that name defines the ejb-name so this should be right. But i get one consumer for the testing and one consumer for the hwtracking queue.
The jboss log shows that two mdbs are deployed:
09:55:24,267 INFO [org.jboss.ejb3.EJBContainer] STARTED EJB: test.AdvancedTrackingConsumer ejbName: HardwareTrackingConsumer
09:55:24,299 INFO [org.apache.activemq.ra.ActiveMQEndpointWorker] Starting
09:55:24,301 WARN [org.jboss.ejb3.TimerServiceContainer] EJBTHREE-2193: using deprecated TimerServiceFactory for restoring timers
09:55:24,304 INFO [org.apache.activemq.ra.ActiveMQEndpointWorker] Establishing connection to broker [xxx:61616]
09:55:24,311 INFO [org.jboss.ejb3.EJBContainer] STARTED EJB: test.AdvancedTrackingConsumer ejbName: HardwareTrackingConsumer
09:55:24,313 INFO [org.apache.activemq.ra.ActiveMQEndpointWorker] Starting
09:55:24,313 WARN [org.jboss.ejb3.TimerServiceContainer] EJBTHREE-2193: using deprecated TimerServiceFactory for restoring timers
Maybe its not important but the consumer is part of a .jar file inside an ear but the ejb-jar is inside the ear (so the config can be changed without repacking the jar)