You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Abdul Alhazred <th...@tradedesksoftware.com> on 2008/04/27 18:21:03 UTC

JBoss EJB3 MDB delivery failure

Hi,

I have a little problem with a JBoss EJB3 MDB. Using JBoss 4.0.5GA and AMQ
4.1. Generally it seems JBoss has no problems with deploying the
ConnectionFactories, etc., and MDB message inflow appears to work fine. That
is messages are delivered with no problems, and if I create a POJO and have
it manually look up the CF and the destination, etc I can reliably receive
messages.

The problem comes in when the EJB3 MDB receives a message, there is an
exception, and the exception is propagated back out of the onMessage()
method of the MDB. From that point on, the MDB is dead. Nothing is ever
received again. Examining the state on the AMQ side in JMX shows the broker
believes there is a consumer, but no messages are ever dequeued from the
queue. 

Calling stop() and then start() methods in the JBoss JMX console on the
MDB's service management interface seems to deal with the problem. Now I get
messages again. If I set the MDB up to use transactions, I get redelivery of
the offending message. 

I just do not know what might be causing the issue. 

There isn't anything particularly unusual about my configuration. 

@MessageDriven(activationConfig =  {
activationConfig =  {
		  @ActivationConfigProperty(propertyName = "acknowledgeMode",
propertyValue = "Auto-acknowledge"),
		  @ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Queue"),
		  @ActivationConfigProperty(propertyName = "destination", propertyValue =
"ets.queue.witadapter")
		})
@ResourceAdapter("activemq-rar-4.1.rar")
public class OMSMDBConnector implements MessageListener {
...
	@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
	public void onMessage(Message message) {
			ObjectMessage omsg = (ObjectMessage) message;
			ETSEventMessage evt = (ETSEventMessage) omsg.getObject();
			LOGGER.debug("OMSMDBConnector received event type
"+evt.getClass().getName());
			if(evt instanceof ETSExecutionEvent ) {
				postToWIT((ETSExecutionEvent) evt);
			} else if(evt instanceof ETSLogEvent) {
				postToWIT((ETSLogEvent)evt);
			} else {
				LOGGER.debug("Event type not supported, discarding");
			}
    }
...
}

And the connection factory/destination configuration is:

<connection-factories>
   <tx-connection-factory>
      <jndi-name>activemq/QueueConnectionFactory</jndi-name>
	  <!--      <xa-transaction />
	  <track-connection-by-tx/> --> <!-- Thanks to Adrian Brock for pointing
this one out! -->
      <rar-name>activemq-rar-4.1.rar</rar-name>
     
<connection-definition>javax.jms.QueueConnectionFactory</connection-definition>
	 
<ServerUrl>failover:(tcp://localhost:61616)?maxReconnectAttempts=2</ServerUrl>
   </tx-connection-factory>

   <mbean code="org.jboss.resource.deployment.AdminObject"
name="activemq.queue:name=ets.witadapter">
	   <attribute name="JNDIName">ets/queue/witadapter</attribute>
	   <depends
optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-rar-4.1.rar'</depends>
	   <attribute name="Type">javax.jms.Queue</attribute>
	   <attribute
name="Properties">PhysicalName=ets.queue.witadapter</attribute>
   </mbean>

Not sure what else to mess with here. 
-- 
View this message in context: http://www.nabble.com/JBoss-EJB3-MDB-delivery-failure-tp16925458s2354p16925458.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.