@CamelConfiguration(value="inMsgRouteBean") public class AsynchInMessageRoute extends AbstractBasicRoute
Message
entity
AsynchResponseProcessor
Modifier and Type | Field and Description |
---|---|
static String |
ROUTE_BEAN |
static String |
ROUTE_ID_ASYNC
The main route for processing incoming asynchronous messages.
|
EXTERNAL_ROUTE_SUFFIX, IN_ROUTE_SUFFIX, OUT_ROUTE_SUFFIX, ROUTE_ID_DELIMITER, ROUTE_SUFFIX
Constructor and Description |
---|
AsynchInMessageRoute() |
Modifier and Type | Method and Description |
---|---|
void |
createFailResponse(org.apache.camel.Exchange exchange)
Creates FAIL response
CallbackResponse
and saves it into AsynchConstants.ERR_CALLBACK_RES_PROP exchange property. |
CallbackResponse |
createOkResponse(org.apache.camel.Exchange exchange)
Creates OK response.
|
void |
doConfigure()
Route for incoming asynchronous message input operation.
|
Message |
insertMessage(Message msg)
Insert new message into database.
|
boolean |
isMsgInGuaranteedOrder(Message msg)
Checks if specified message should be processed in guaranteed order and if yes
then checks if the message is in the right order.
|
void |
postponeMessage(org.apache.camel.Exchange exchange,
Message msg) |
void |
saveLogContextParams(Message msg,
Map<String,Object> headers)
Saves log request ID into header
LogContextFilter.CTX_REQUEST_ID . |
void |
setInsertQueueTimestamp(Map<String,Object> headers) |
void |
setMsgPriority(Message msg) |
addEventNotifier, configure, doErrorHandling, exceptionHandling, getBean, getExternalRouteId, getInRouteId, getInWsUri, getInWsUri, getOutRouteId, getOutWsSoap12Uri, getOutWsSoap12Uri, getOutWsUri, getOutWsUri, getRouteId, isAsynch, printMessageHistory, toString
getApplicationContext, lookup, lookup, setApplicationContext, transactionErrorHandler, transactionErrorHandler, transactionErrorHandler, transactionErrorHandler
addRoutes, addRoutesToCamelContext, checkInitialized, configureRest, configureRests, configureRoute, configureRoutes, createContainer, errorHandler, from, from, from, from, fromF, getContext, getRestCollection, getRestConfigurations, getRouteCollection, includeRoutes, intercept, interceptFrom, interceptFrom, interceptSendToEndpoint, onCompletion, onException, onException, populateRests, populateRoutes, rest, rest, restConfiguration, restConfiguration, setErrorHandlerBuilder, setRestCollection, setRouteCollection
bean, bean, bean, bean, body, body, bodyAs, constant, createErrorHandlerBuilder, deadLetterChannel, deadLetterChannel, defaultErrorHandler, endpoint, endpoint, endpoints, endpoints, exceptionMessage, exchangeProperty, faultBody, faultBodyAs, getErrorHandlerBuilder, header, language, loggingErrorHandler, loggingErrorHandler, loggingErrorHandler, loggingErrorHandler, method, method, method, method, noErrorHandler, outBody, outBody, property, regexReplaceAll, regexReplaceAll, sendTo, setContext, setContext, simple, simple, simpleF, simpleF, systemProperty, systemProperty, xpath, xpath
public static final String ROUTE_BEAN
public static final String ROUTE_ID_ASYNC
public void doConfigure() throws Exception
Prerequisite: defined message headers AsynchConstants.SERVICE_HEADER
, AsynchConstants.OPERATION_HEADER
and optional AsynchConstants.OBJECT_ID_HEADER
Output: CallbackResponse
for OK message or fill AsynchConstants.ERR_CALLBACK_RES_PROP
exchange property
if error occurred
doConfigure
in class AbstractBasicRoute
Exception
- can be thrown during configuration@Handler public Message insertMessage(@Body Message msg)
msg
- message that will be saved@Handler public boolean isMsgInGuaranteedOrder(@Body Message msg)
msg
- the asynchronous messagetrue
if message's order is ok otherwise false
@Handler public void postponeMessage(org.apache.camel.Exchange exchange, @Body Message msg)
@Handler public void saveLogContextParams(@Body Message msg, @Headers Map<String,Object> headers)
LogContextFilter.CTX_REQUEST_ID
.
It's because child threads don't inherits this information from parent thread automatically.msg
- the messageheaders
- the incoming message headers@Handler public void setInsertQueueTimestamp(@Headers Map<String,Object> headers)
@Handler public void setMsgPriority(@Body Message msg)
@Handler public CallbackResponse createOkResponse(org.apache.camel.Exchange exchange)
exchange
- the exchange@Handler public void createFailResponse(org.apache.camel.Exchange exchange)
CallbackResponse
and saves it into AsynchConstants.ERR_CALLBACK_RES_PROP
exchange property.exchange
- the exchangeCopyright © 2018 Pivotal Software, Inc.. All rights reserved.