Hi Robert,

yes it is thread safe, the enum is static but not he value itself.

You should get an exception before this one in the logs. Basically the MDB
throws an exception and then the JMS lifecycle can't be completed properly.
This is what means the message.



Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-08-17 11:50 GMT-07:00 Robert Bray <[email protected]>:

> I have this error when I bombard my app with lots of requests which
> generates
> many threads concurrently trying  send some JMS messages.
>
> SEVERE: error dispatching message:
> java.lang.IllegalStateException: The last message delivery must be
> completed
> wit
> h an afterDeliver before another message can be delivered
>         at
> org.apache.openejb.core.mdb.EndpointHandler.deliverMessage(EndpointHa
> ndler.java:221)
>         at
> org.apache.openejb.core.mdb.EndpointHandler.invoke(EndpointHandler.ja
> va:169)
>         at my.app.class$$LocalBeanProxy.onMessage(my/app/class.java)
>         at
> org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMe
> ssage(MessageEndpointProxy.java:123)
>         at
> org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpoint
> Proxy.java:64)
>         at
> org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:994)
>         at
> org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:1
> 69)
>         at
> org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.ja
> va:366)
>         at
> org.apache.geronimo.connector.work.pool.NamedRunnable.run(NamedRunnab
> le.java:32)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
> Source)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
>         at java.lang.Thread.run(Unknown Source)
>
> I may be looking at things wrong, but I notice that the state is a static
> member of EndpointHandler and I am clearly calling this code from several
> threads.    Is EndpointHandler thread safe?
>
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/java-lang-IllegalStateException-The-last-message-delivery-must-be-completed-wit-h-an-afterDeliver-bed-tp4675921.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Reply via email to