Configuring an MDB to listen to multiple queues

前端 未结 2 1286
傲寒
傲寒 2020-12-11 08:42

I\'m using EJB 3.1 and I want to configure an MDB to listen to multiple queues.
I\'d prefer defining the queue names via XML but the other definitions via annotations.

2条回答
  •  眼角桃花
    2020-12-11 08:43

    use ejb-jar.xml instead of ibm-ejb-jar-bnd.xml

        
            MessageDrivenBean1
            com.sample.MessageDrivenBean
            javax.jms.MessageListener
            Container
            
                
                    destinationType
                    javax.jms.Queue
                
            
        
    
        
            MessageDrivenBean2
            com.sample.MessageDrivenBean
            javax.jms.MessageListener
            Container
            
                
                    destinationType
                    javax.jms.Queue
                
            
        
    
    
    

    And remove @MessageDriven annotation from your Java class

    '@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
        })'
    

提交回复
热议问题