2017-01-27 1 views
0

MDB (Message Driven Bean)에서 "대상"에 대한 런타임 값을 동적으로 할당 할 수 있습니까?TomEE MDB 메시지 구동 콩

주석 기반의 접근 방식의 힘이 나는 또한 EJB-jar.xml의 접근을 시도

@MessageDriven(name="PingPongMDB", activationConfig = { 
    @ActivationConfigProperty(
      propertyName = "destinationType", 
      propertyValue = "javax.jms.Queue"), 
     @ActivationConfigProperty(
      propertyName = "destination", 
      propertyValue = "ref_fooQueue")}) 
public class PingPongMDB implements MessageListener { 

MDB

에 하드 코드,하지만 "활성화 - 설정 - 프로퍼티 이름"= "대상"에 대한 값은 읽기 대기열의 실제 이름으로 사용할 수 있습니다. 따라서 자원의 JNDI 조회를 수행 할 수 없습니다.

<message-driven> 

    <ejb-name>PingPongMDB</ejb-name> 
    <ejb-class>com.company.sample.services.PingPongMDB</ejb-class> 

    <messaging-type>javax.jms.MessageListener</messaging-type> 

    <activation-config> 
    <activation-config-property> 
     <activation-config-property-name>destination</activation-config-property-name> 
     <activation-config-property-value>openejb:Resource/ref_fooQueue</activation-config-property-value> 
    </activation-config-property> 
    <activation-config-property> 
     <activation-config-property-name>destinationType</activation-config-property-name> 
     <activation-config-property-value>javax.jms.Queue</activation-config-property-value> 
    </activation-config-property> 
    </activation-config> 

</message-driven> 

속성에서 대상을 읽고 할당하거나 -D 매개 변수를 사용하여 값을 전달하는 올바른 방법은 무엇입니까? 사람이 그것을 발견하면

답변

관련 문제