307.8. 예외 처리
이 구성 요소는 일반 Camel 예외 처리 기능을 지원합니다.
SubmitSm(기본 작업)으로 메시지를 보내는 중 오류가 발생하면 org.apache.camel.component.smpp.Smpp.SmppException이 중첩되어 있고 org.jsmpp.extra.NegativeResponseException이 발생합니다. 정확한 SMPP 부정 응답 코드를 얻기 위해 NegativeResponseException.getCommandStatus()를 호출하여 값은 SMPP 사양 3.4, 섹션 5.1.3에 설명되어 있습니다.
Camel 2.8 이상: SMPP 소비자가 DeliverSm
또는 DataSm
짧은 메시지와 이러한 메시지 처리가 실패하면 오류를 처리하는 대신 ProcessRequestException
을 throw할 수도 있습니다. 이 경우 이 예외는 포함된 오류 코드를 SMSC에 반환하는 기본 JSMPP 라이브러리 로 전달됩니다. 이 기능은 예를 들어 SMSC가 나중에 짧은 메시지를 다시 보내도록 지시하는 데 유용합니다. 다음 코드 줄로 수행할 수 있습니다.
from("smpp://smppclient@localhost:2775?password=password&enquireLinkTimer=3000&transactionTimer=5000&systemType=consumer") .doTry() .to("bean:dao?method=updateSmsState") .doCatch(Exception.class) .throwException(new ProcessRequestException("update of sms state failed", 100)) .end();
오류 코드의 전체 목록과 해당 의미는 대한 SMPP 사양 을 참조하십시오.