You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by ZhongGuan <gu...@gmail.com> on 2013/11/25 10:47:42 UTC

redelivery of MDB with BMT

Hi,

I have a MDB using BMT. I want to keep the message in Queue By throw a
RuntimeException.
But it does not work, I monitor the ActiveMq, the message has been Dequeued?

another question, How can I monitor the internal ActiveMQ in TomEE by
webconsole  or Jconsole?

thanks.



--
View this message in context: http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: redelivery of MDB with BMT

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Did you set usejmx to true?
http://tomee.apache.org/activemqresourceadapter-config.html
Le 25 nov. 2013 17:56, "ZhongGuan" <gu...@gmail.com> a écrit :

> Thanks Leo, I will try it later. In fact,
> If I use the external ActiveMQ at local.I can see the url in Jconsole.
> But if I use internal ActiveMQ in TomEE at local , I can not find the Url
> in
> Jconsole.
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666398.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: redelivery of MDB with BMT

Posted by ZhongGuan <gu...@gmail.com>.
Hi Leo,
Here is the result.
According the setting of Internal ActiveMQ Broker in
http://tomee.apache.org/jms-resources-and-mdb-container.html

And add "useJmx=true" to the brokerXmlConfig, that is 

	<Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
		brokerXmlConfig = broker:(tcp://localhost:61616)?useJmx=true
		serverUrl       =  vm://localhost    
	</Resource>
	
	<Resource id="MyJmsConnectionFactory" type="javax.jms.ConnectionFactory">
		ResourceAdapter = MyJmsResourceAdapter
	</Resource>
	
	<Container id="MyJmsMdbContainer" ctype="MESSAGE">
        	ResourceAdapter = MyJmsResourceAdapter
        </Container>

after Tomee starts up, You can find the info of tomee in jconsole local
process .
and connect it , you can find the org.apache.activemq in MBeans Tab. and you
can monitor
the internal ActiveMQ :)

Thanks Leo and Romain



--
View this message in context: http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666421.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: redelivery of MDB with BMT

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
Maybe because I start my tomee from inside eclipse and jconsole from the
command line :-)

[]

Leo


On Mon, Nov 25, 2013 at 3:10 PM, Romain Manni-Bucau
<rm...@gmail.com>wrote:

> I dont get you, embed amq is in tomee jvm and jmx is active with usejmx
> option
> Le 25 nov. 2013 18:06, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :
>
> > I use tomee's embedded activemq at localhost.
> >
> > It does not appear at jconsole in the "local process" section.
> >
> > Instead, I have to enter this address manually in the "remote process"
> > section.
> >
> > so I choose the radiobox "remote process" and fill it with
> > "service:jmx:rmi://localhost:1099/jmxrmi", user and password empty
> >
> >
> >
> > []
> >
> > Leo
> >
> >
> > On Mon, Nov 25, 2013 at 2:54 PM, ZhongGuan <gu...@gmail.com>
> wrote:
> >
> > > Thanks Leo, I will try it later. In fact,
> > > If I use the external ActiveMQ at local.I can see the url in Jconsole.
> > > But if I use internal ActiveMQ in TomEE at local , I can not find the
> Url
> > > in
> > > Jconsole.
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666398.html
> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > >
> >
>

Re: redelivery of MDB with BMT

Posted by Romain Manni-Bucau <rm...@gmail.com>.
I dont get you, embed amq is in tomee jvm and jmx is active with usejmx
option
Le 25 nov. 2013 18:06, "Leonardo K. Shikida" <sh...@gmail.com> a écrit :

> I use tomee's embedded activemq at localhost.
>
> It does not appear at jconsole in the "local process" section.
>
> Instead, I have to enter this address manually in the "remote process"
> section.
>
> so I choose the radiobox "remote process" and fill it with
> "service:jmx:rmi://localhost:1099/jmxrmi", user and password empty
>
>
>
> []
>
> Leo
>
>
> On Mon, Nov 25, 2013 at 2:54 PM, ZhongGuan <gu...@gmail.com> wrote:
>
> > Thanks Leo, I will try it later. In fact,
> > If I use the external ActiveMQ at local.I can see the url in Jconsole.
> > But if I use internal ActiveMQ in TomEE at local , I can not find the Url
> > in
> > Jconsole.
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666398.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>

Re: redelivery of MDB with BMT

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
I use tomee's embedded activemq at localhost.

It does not appear at jconsole in the "local process" section.

Instead, I have to enter this address manually in the "remote process"
section.

so I choose the radiobox "remote process" and fill it with
"service:jmx:rmi://localhost:1099/jmxrmi", user and password empty



[]

Leo


On Mon, Nov 25, 2013 at 2:54 PM, ZhongGuan <gu...@gmail.com> wrote:

> Thanks Leo, I will try it later. In fact,
> If I use the external ActiveMQ at local.I can see the url in Jconsole.
> But if I use internal ActiveMQ in TomEE at local , I can not find the Url
> in
> Jconsole.
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666398.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: redelivery of MDB with BMT

Posted by ZhongGuan <gu...@gmail.com>.
Thanks Leo, I will try it later. In fact, 
If I use the external ActiveMQ at local.I can see the url in Jconsole.
But if I use internal ActiveMQ in TomEE at local , I can not find the Url in
Jconsole.




--
View this message in context: http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666398.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: redelivery of MDB with BMT

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
to use jconsole, ensure that system.properties has openejb.jmx.active =
true and use jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi (no user or
password)

see http://activemq.apache.org/jmx.html

[]

Leo


On Mon, Nov 25, 2013 at 7:47 AM, ZhongGuan <gu...@gmail.com> wrote:

> Hi,
>
> I have a MDB using BMT. I want to keep the message in Queue By throw a
> RuntimeException.
> But it does not work, I monitor the ActiveMq, the message has been
> Dequeued?
>
> another question, How can I monitor the internal ActiveMQ in TomEE by
> webconsole  or Jconsole?
>
> thanks.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: redelivery of MDB with BMT

Posted by AndyG <an...@orprovision.com>.
Something else that may help is to override the default broker option:

useAsyncSend=false

This will ensure that the acknowledge is sent in-line.



--
View this message in context: http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666427.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: redelivery of MDB with BMT

Posted by AndyG <an...@orprovision.com>.
OK, I am wrong here:

CLIENT_ACKNOWLEDGE is not really supported on an EJB, so it must be the
'useAsyncSend=false' that is required to get this working the way you want.
I think the client URL parameter is 'async=false'.

Andy.



--
View this message in context: http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666428.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: redelivery of MDB with BMT

Posted by AndyG <an...@orprovision.com>.
OK, so this seems like a bad design to me.

@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue =
"Auto-acknowledge"

So the chances are the message is acknowledged and dequeued if all
subscribers have it. This can also be asynchronous, so you have no control
over the message state.

Throwing a RuntimeException just to rollback the acknowledgement is highly
likely to fail, and not good practice. It may have already been
acknowledged.

Using CLIENT_ACKNOWLEDGE is a much better way to just peek at a message
without dequeuing.

Also, what is the time to live on the message (also ensure the client and
server times synchronized)?.

Andy



--
View this message in context: http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666424.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: redelivery of MDB with BMT

Posted by ZhongGuan <gu...@gmail.com>.
Hi
I will take a look at the doc.
before that I tested the BMT and CMT and here is the result.
BMT
when RuntimeException occurs, no redelivery, message is dequeued and is not
dispatched to DLQ.
CMT
when RuntimeException occurs, the messsage is redelivered for 5 times and at
last, the message is dispatched to DLQ.

The behavior of CMT is what I need. (I think I can set the redelivey to 1
time).
But I need particular transaction strategy, So I have to chose BMT.

thanks 



--
View this message in context: http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666472.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: redelivery of MDB with BMT

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

does this doc help
http://activemq.apache.org/message-redelivery-and-dlq-handling.html ?
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2013/11/26 ZhongGuan <gu...@gmail.com>:
> I use the default setting. and if I change the TransactionManagementType to
> CONTAINER,
> I can see the message redelivaries for about 5 times. But after this, the
> message still be dequeued.
> How can I make the message stay in queue, when I am not ready for dealing
> with the message right now.
>
> thanks.
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666422.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: redelivery of MDB with BMT

Posted by "Leonardo K. Shikida" <sh...@gmail.com>.
I think this is not elegant, but maybe, instead of using a MDB as a queue
consumer (since all its parameters are hardcoded), you can set a timer to
poll the queue using @Timeout and @Schedule (let´s say every minute for
example) and consume selectively using a programmatic JMS selector using
session.createConsumer(queue,selector)



[]

Leo


On Tue, Nov 26, 2013 at 9:56 AM, ZhongGuan <gu...@gmail.com> wrote:

> I use the default setting. and if I change the TransactionManagementType to
> CONTAINER,
> I can see the message redelivaries for about 5 times. But after this, the
> message still be dequeued.
> How can I make the message stay in queue, when I am not ready for dealing
> with the message right now.
>
> thanks.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666422.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: redelivery of MDB with BMT

Posted by ZhongGuan <gu...@gmail.com>.
I use the default setting. and if I change the TransactionManagementType to
CONTAINER,
I can see the message redelivaries for about 5 times. But after this, the
message still be dequeued.
How can I make the message stay in queue, when I am not ready for dealing
with the message right now.

thanks.



--
View this message in context: http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666422.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: redelivery of MDB with BMT

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Did you check the dlq? What's your prefetch policy?
Le 26 nov. 2013 06:43, "ZhongGuan" <gu...@gmail.com> a écrit :

> I test it in another environment, also a very simple example of MDB using
> BMT
> and throw RuntimeException.
> But it does not work. :(
>
> Here is My MDB code
> @MessageDriven(activationConfig = {
>         @ActivationConfigProperty(propertyName = "destination",
> propertyValue = "FooQueue"),
>         @ActivationConfigProperty(propertyName = "destinationType",
> propertyValue = "javax.jms.Queue"),
>         @ActivationConfigProperty(propertyName = "acknowledgeMode",
> propertyValue = "Auto-acknowledge")})
> @TransactionManagement(TransactionManagementType.BEAN)
> public class HelloMDB implements MessageListener {
>
>     @Override
>     public void onMessage(Message arg0) {
>         System.out.println(1111111);
>         throw new RuntimeException();
>     }
>
> }
>
> And here is the info on console after the first Exception. and the message
> does not redelivery.
>
> java.rmi.RemoteException: The bean encountered a non-application exception;
> nested exception is:
>         java.lang.RuntimeException
>         at
>
> org.apache.openejb.core.transaction.EjbTransactionUtil.handleSystemException(EjbTransactionUtil.java:154)
>         at
> org.apache.openejb.core.mdb.MdbContainer._invoke(MdbContainer.java:434)
>         at
> org.apache.openejb.core.mdb.MdbContainer.invoke(MdbContainer.java:387)
>         at
>
> org.apache.openejb.core.mdb.EndpointHandler.deliverMessage(EndpointHandler.java:227)
>         at
>
> org.apache.openejb.core.mdb.EndpointHandler.invoke(EndpointHandler.java:168)
>         at example.HelloMDB$LocalBeanProxy.onMessage(example/HelloMDB.java)
>         at
>
> org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:123)
>         at
>
> org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:64)
>         at
> org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:861)
>         at
> org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:169)
>         at
>
> org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:366)
>         at
>
> org.apache.geronimo.connector.work.pool.NamedRunnable.run(NamedRunnable.java:32)
>         at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>         at java.lang.Thread.run(Thread.java:722)
> Caused by: java.lang.RuntimeException
>         at example.HelloMDB.onMessage(HelloMDB.java:24)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at
>
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
>         at
>
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
>         at
> org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:126)
>         at
> org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:42)
>         at
> org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:63)
>         at
> org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:69)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at
>
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
>         at
>
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
>         at
>
> org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176)
>         at
>
> org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at
>
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
>         at
>
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
>         at
>
> org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138)
>         at
> org.apache.openejb.core.mdb.MdbContainer._invoke(MdbContainer.java:416)
>         ... 13 more
> 11 26, 2013 2:27:47 午後 org.apache.activemq.ActiveMQSession run
> 重大: error dispatching message:
> javax.ejb.EJBException
>         at
>
> org.apache.openejb.core.mdb.EndpointHandler.deliverMessage(EndpointHandler.java:251)
>         at
>
> org.apache.openejb.core.mdb.EndpointHandler.invoke(EndpointHandler.java:168)
>         at example.HelloMDB$LocalBeanProxy.onMessage(example/HelloMDB.java)
>         at
>
> org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:123)
>         at
>
> org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:64)
>         at
> org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:861)
>         at
> org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:169)
>         at
>
> org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:366)
>         at
>
> org.apache.geronimo.connector.work.pool.NamedRunnable.run(NamedRunnable.java:32)
>         at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>         at java.lang.Thread.run(Thread.java:722)
> Caused by: java.rmi.RemoteException: The bean encountered a non-application
> exception; nested exception is:
>         java.lang.RuntimeException
>         at
>
> org.apache.openejb.core.transaction.EjbTransactionUtil.handleSystemException(EjbTransactionUtil.java:154)
>         at
> org.apache.openejb.core.mdb.MdbContainer._invoke(MdbContainer.java:434)
>         at
> org.apache.openejb.core.mdb.MdbContainer.invoke(MdbContainer.java:387)
>         at
>
> org.apache.openejb.core.mdb.EndpointHandler.deliverMessage(EndpointHandler.java:227)
>         ... 11 more
> Caused by: java.lang.RuntimeException
>         at example.HelloMDB.onMessage(HelloMDB.java:24)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at
>
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
>         at
>
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
>         at
> org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:126)
>         at
> org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:42)
>         at
> org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:63)
>         at
> org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:69)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at
>
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
>         at
>
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
>         at
>
> org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176)
>         at
>
> org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at
>
> org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
>         at
>
> org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
>         at
>
> org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138)
>         at
> org.apache.openejb.core.mdb.MdbContainer._invoke(MdbContainer.java:416)
>         ... 13 more
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666418.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: redelivery of MDB with BMT

Posted by ZhongGuan <gu...@gmail.com>.
I test it in another environment, also a very simple example of MDB using BMT
and throw RuntimeException.
But it does not work. :(

Here is My MDB code
@MessageDriven(activationConfig = {
        @ActivationConfigProperty(propertyName = "destination",
propertyValue = "FooQueue"),
        @ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "acknowledgeMode",
propertyValue = "Auto-acknowledge")})
@TransactionManagement(TransactionManagementType.BEAN)
public class HelloMDB implements MessageListener {

    @Override
    public void onMessage(Message arg0) {
        System.out.println(1111111);
        throw new RuntimeException();
    }

}

And here is the info on console after the first Exception. and the message
does not redelivery.

java.rmi.RemoteException: The bean encountered a non-application exception;
nested exception is: 
	java.lang.RuntimeException
	at
org.apache.openejb.core.transaction.EjbTransactionUtil.handleSystemException(EjbTransactionUtil.java:154)
	at org.apache.openejb.core.mdb.MdbContainer._invoke(MdbContainer.java:434)
	at org.apache.openejb.core.mdb.MdbContainer.invoke(MdbContainer.java:387)
	at
org.apache.openejb.core.mdb.EndpointHandler.deliverMessage(EndpointHandler.java:227)
	at
org.apache.openejb.core.mdb.EndpointHandler.invoke(EndpointHandler.java:168)
	at example.HelloMDB$LocalBeanProxy.onMessage(example/HelloMDB.java)
	at
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:123)
	at
org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:64)
	at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:861)
	at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:169)
	at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:366)
	at
org.apache.geronimo.connector.work.pool.NamedRunnable.run(NamedRunnable.java:32)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.RuntimeException
	at example.HelloMDB.onMessage(HelloMDB.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
	at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:126)
	at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:42)
	at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:63)
	at
org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:69)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
	at
org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176)
	at
org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
	at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138)
	at org.apache.openejb.core.mdb.MdbContainer._invoke(MdbContainer.java:416)
	... 13 more
11 26, 2013 2:27:47 午後 org.apache.activemq.ActiveMQSession run
重大: error dispatching message: 
javax.ejb.EJBException
	at
org.apache.openejb.core.mdb.EndpointHandler.deliverMessage(EndpointHandler.java:251)
	at
org.apache.openejb.core.mdb.EndpointHandler.invoke(EndpointHandler.java:168)
	at example.HelloMDB$LocalBeanProxy.onMessage(example/HelloMDB.java)
	at
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:123)
	at
org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:64)
	at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:861)
	at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:169)
	at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:366)
	at
org.apache.geronimo.connector.work.pool.NamedRunnable.run(NamedRunnable.java:32)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.rmi.RemoteException: The bean encountered a non-application
exception; nested exception is: 
	java.lang.RuntimeException
	at
org.apache.openejb.core.transaction.EjbTransactionUtil.handleSystemException(EjbTransactionUtil.java:154)
	at org.apache.openejb.core.mdb.MdbContainer._invoke(MdbContainer.java:434)
	at org.apache.openejb.core.mdb.MdbContainer.invoke(MdbContainer.java:387)
	at
org.apache.openejb.core.mdb.EndpointHandler.deliverMessage(EndpointHandler.java:227)
	... 11 more
Caused by: java.lang.RuntimeException
	at example.HelloMDB.onMessage(HelloMDB.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
	at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:126)
	at org.apache.openejb.cdi.CdiInterceptor.access$000(CdiInterceptor.java:42)
	at org.apache.openejb.cdi.CdiInterceptor$1.call(CdiInterceptor.java:63)
	at
org.apache.openejb.cdi.CdiInterceptor.aroundInvoke(CdiInterceptor.java:69)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
	at
org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:176)
	at
org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:95)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
	at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
	at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:138)
	at org.apache.openejb.core.mdb.MdbContainer._invoke(MdbContainer.java:416)
	... 13 more



--
View this message in context: http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666418.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: redelivery of MDB with BMT

Posted by ZhongGuan <gu...@gmail.com>.
Hi
I wrote a simple example just now using MDB BMT and throw RuntimeException,
it worked.
I mean container does not acknowledge the message. I will check my code
again later. 
sorry about this question.
thanks Andy.
 



--
View this message in context: http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666399.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: redelivery of MDB with BMT

Posted by AndyG <an...@orprovision.com>.
Would you like to share some code to help you solve this problem.

Andy



--
View this message in context: http://openejb.979440.n4.nabble.com/redelivery-of-MDB-with-BMT-tp4666382p4666387.html
Sent from the OpenEJB User mailing list archive at Nabble.com.