/**
* Route for asynchronous <strong>asyncHello</strong> input operation.
* <p/>
* Prerequisite: none
* <p/>
* Output: {@link AsyncHelloResponse}
*/
private void createRouteForAsyncHelloRouteIn() throws FailedToCreateRouteException {
Namespaces ns = new Namespaces("h", SyncHelloRoute.HELLO_SERVICE_NS);
// note: mandatory parameters are set already in XSD, this validation is extra
XPathValidator validator1 = new XPathValidator("/h:asyncHelloRequest", ns, "h:name1");
// note: mandatory parameters are set already in XSD, this validation is extra
XPathValidator validator2 = new XPathValidator("/h:asyncHelloRequest", ns, "h:name2");
// note: only shows using but without any influence in this case
Expression nameExpr = xpath("/h:asyncHelloRequest/h:name").namespaces(ns).stringResult();
AsynchRouteBuilder.newInstance(ServiceEnum.HELLO, OPERATION_NAME,
getInWsUri(new QName(SyncHelloRoute.HELLO_SERVICE_NS, "asyncHelloRequest")),
new AsynchResponseProcessor() {
@Override
protected Object setCallbackResponse(CallbackResponse callbackResponse) {
AsyncHelloResponse res = new AsyncHelloResponse();
res.setConfirmAsyncHello(callbackResponse);
return res;
}
}, jaxb(AsyncHelloResponse.class))
.withValidator(validator1, validator2)
.withObjectIdExpr(nameExpr)
.build(this);
} |
Receive asynchronous message
Receive asynchronous messages and storing them to DB:
Hereby accepting an asynchronous message ends, is persisted in internal database for further processing and OpenHub framework sends confirmation to external system that message was adopted.