]
Tomas Remes commented on CDI-696:
---------------------------------
OK so it doesn't seem to work. So the question is whether it should. I cannot find
such evidence in specifications. EJB 3.2 spec defines only support for interceptors in
{{5.4.10 Message Listener Interceptor Methods for Message-Driven Beans}} AFAIK.
Decorator for MDB is not used
-----------------------------
Key: CDI-696
URL:
https://issues.jboss.org/browse/CDI-696
Project: CDI Specification Issues
Issue Type: Bug
Components: Decorators, Java EE integration
Reporter: Alexandr Sokolov
Guys, I'm using Wildfly 8.2.1.Final
Here is MDB bean:
{code:java}
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationLookup",
propertyValue = "topic/dse"),
@ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Topic")
})
public class JobChangedSubscriber implements MessageListener {
...
@Override
public void onMessage(final Message message) {
...
}
}
{code}
And decorator:
{code:java}
@Decorator
public class RetroplannerSubscriber implements MessageListener {
@Inject
@Delegate
@Any
JobChangedSubscriber jobChangedSubscriber;
@Override
public void onMessage(Message message) {
jobChangedSubscriber.onMessage(message);
//custom code
}
}
{code}
During deployment, all mistakes about decorator definition are shown. They were fixed. I
was sure it would work. But now, only JobChangedSubscriber.onMessage() is invoked.
As a user I want to decorate MDB as an usual CDI bean. What am I doing wrong?