2011-12-15 3 views
2

javax.jms.Message.getIntProperty ("JMSXDeliveryCount")를 사용하여 현재 배달 수를 읽을 수 있습니다. 현재 최대 재 시도 설정을 읽으려고합니다. jms-service.xml에서 다음 구성을 사용하여 5로 구성했습니다. MDB에서 최대 재시도 횟수를 얻는 방법은 무엇입니까?

<attribute name="MaxDeliveryAttempts">5</attribute> 

하지만

  • javax.jms.Message.propertyExists ("dLQMaxResent")를 사용하여 읽을 때 JBoss
  • javax.jms.Message.propertyExists ("MaxDeliveryAttempts")
  • javax.jms .Message.propertyExists ("DLQMaxResent")
  • javax.jms.Message.propertyExists ("MaxDeliveryCnt") Oracle

모든 위의 false를 반환합니다. jboss 메시징과 함께 JBoss EAP 5.0.1을 사용하고 있습니다.

찾고 싶은 부동산에 대한 제안이 있으십니까?

답변

0

@MaDa가 그렇게 말한 것처럼, 이것은 MBean 구성입니다.

다음 코드를 사용하면 JBoss 환경에서 JMX MBean 설정을 읽을 수 있습니다.

javax.management.MBeanServer server = org.jboss.mx.util.MBeanServerLocator.locateJBoss(); 
server.getAttribute(new javax.management.ObjectName(mbeanName), attributeName); 

server.getAttribute(new javax.management.ObjectName("jboss.messaging.destination:service=Queue,name=testQueue"),"MaxDeliveryAttempts"); 

이 경우 사용자의 의존성에 jboss-jmx.jar을 포함시켜야합니다.

0

은 당신이 <attribute name="MaxDeliveryAttempts">으로 설정하는 것은 MBean에 구성입니다,하지만 당신은 메시지에서 그것을 읽으려고하고 있습니다. 왜 거기에 있어야합니까?

+0

메시지에서 최대 배달 시도를 읽을 수 있습니까? 설정하지 않더라도 기본값은 10입니다. 현재 설정을 읽을 수 있기를 원합니다. – chinto

관련 문제