Callback (user function)
Callback is the feature that delivers Agent processing results to a user function or endpoint in your system.
Main purposes
- Automate post-processing of send results.
- Synchronize state with your internal business systems.
- Trigger reprocessing of failed items.
Implementation points
- Handle idempotency based on the message identification keys (
messageKey,ref). - Define the timeout, retry count, and backoff policy.
- Set up a separate retention/resend queue for failed callbacks.
Operational recommendations
- Run the callback receiving API on a 24x7 availability basis.
- A long response delay can affect Agent throughput, so we recommend asynchronous processing.
- Store the receipt logs and the original payload so they stay traceable.
MTT Callback
MTT (Message Transform Tool) is a user-defined callback interface that lets you transform the data right after the Collector gathers messages from the DB.
Interface
Java
public interface MTTCallback {
boolean doTransform(IBUserObject userObject);
}
Returning false excludes that message from the send.
Main IBUserObject methods
| Field | getter / setter |
|---|---|
| Recipient number | getRecipient() / setRecipient() |
| Text content | getMtContent() / setMtContent() |
| Text title | getMtSubject() / setMtSubject() |
| Kakao content | getKkoContent() / setKkoContent() |
| Other fields | getEtcText1~3() / setEtcText1~3() |
Implementation example
Java
public class MyMTTCallback implements MTTCallback {
@Override
public boolean doTransform(IBUserObject userObject) {
// 수신번호 앞 국가코드 추가
userObject.setRecipient("82" + userObject.getRecipient().replaceFirst("^0", ""));
// 내용 앞에 고정 문구 추가
userObject.setMtContent("[공지] " + userObject.getMtContent());
return true;
}
}
You can apply it by copying the class file you wrote (compiled with Java) to the default path or to a modified path.
- Use the default path: place the class file in the
classes/ib/omni/agent/callbackdirectory. - Change the path: change the
callback.mtt.classvalue inconfig/msgConfig.ymlto the package path you want.
Register it in msgConfig.yml.
YAML
callback:
mtt:
yn: Y
class: ib.omni.agent.callback.SampleMTTCallback