[cdi-dev] [JBoss JIRA] (CDI-696) Decorator for MDB is not used

Tomas Remes (JIRA) issues at jboss.org
Fri Mar 10 05:41:00 EST 2017


    [ https://issues.jboss.org/browse/CDI-696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13375900#comment-13375900 ] 

Tomas Remes commented on CDI-696:
---------------------------------

Hi [~avsokolov],
I don't think your question is adequate as a CDI issue. This sounds more like question on forum. Anyway do you define your {{RetroplannerSubscriber}} in beans.xml as a decorator? I am going to verify this behaviour with WildFly 10.1.0.Final. Not really sure but I think it could work since interception works.  

> 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? 



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the cdi-dev mailing list