0
을 인정하지 :JMS 메시지가 나는 오류를 인정하지이 메시지가 무엇입니까 오류
여기javax.jms.IllegalStateException: Message not delivered
at com.tibco.tibjms.TibjmsxSessionImp._confirmNonTransacted(TibjmsxSessionImp.java:3295)
at com.tibco.tibjms.TibjmsxSessionImp._confirm(TibjmsxSessionImp.java:3644)
at com.tibco.tibjms.TibjmsxSessionImp._confirmNonAuto(TibjmsxSessionImp.java:4980)
at com.tibco.tibjms.TibjmsMessage.acknowledge(TibjmsMessage.java:609)
내 코드입니다 :
public processMessage(Message pMessage){
try{
performOperation();
}
catch(Exception e){
}finally{
if (pMessage != null) {
try {
pMessage.acknowledge();
} catch (Exception e) {
try {
if (pMessage.getJMSRedelivered()) {
log.info("Message has been redelivered");
} else
log.error(("Message has not been delivered"),e);
} catch (JMSException e1) {
log.error(e1);
}
}
}
return null;
}
public boolean performOperation(somedata){
try{
insert into database
}
catch(DataIntegrityViolationException e){
do something
if (pMessage != null){
pMessage.acknowledge();
}
}
}
}
나는 JMS 세션이 생성되고 있는지 확실하지 않다, 나는 코드를 업데이트했다. APP에는 생산자와 소비자가 소품으로 구성되어 있습니다. – user1910892
그건 작동하지 않을 것이다.'pMessage'는'processMessage()'의 범위에 있지 않다. 인자로 넘겨주지 않는다면 말이다. 모든 메시지 관련 작업을 확인하고 processMessage()에 유지해야합니다. – raffian
pMessage를 인수로 전달하고 있습니다. 자세한 내용은 performOperation 메서드에서 다른 조건을 가지고 있으며 각 조건 후에는 인정하지만 각 성공적인 메시지에 대해서는 최종 승인을 사용하고 있습니다. – user1910892