Apache camel route can be executed Asynchronous and Synchronous way.
Synchronous - Sends an asynchronous body to the given endpoint.
Asynchronous - Send the body to an endpoint returning any result output body
Synchronous - Sends an asynchronous body to the given endpoint.
private static org.springframework.beans.factory.BeanFactory BEAN_FACTORY; @Autowired(required = false) private org.apache.camel.ProducerTemplate producerTemplate; /** * Sends an asynchronous body to the given endpoint. * Execute Apache Camel Route Asyncrousnly */ private void sendEmailToReceipients(ReceipientExchange receipientExchange) { try { if (this.producerTemplate == null) { this.producerTemplate = BEAN_FACTORY.getBean("producerTemplate", ProducerTemplate.class); } this.producerTemplate.asyncSendBody(RouteConstants.SEND_EMAIL_ROUTE, receipientExchange); } catch (CamelExecutionException expObj) { } }
Asynchronous - Send the body to an endpoint returning any result output body
private static org.springframework.beans.factory.BeanFactory BEAN_FACTORY; /* * Send the body to an endpoint returning any result output body. */ public void executeTaxComputation(TaxComutePayloadExchange taxPayloadExchange) { Map<String, Object> headers = new HashMap<>(); try { if (this.producerTemplate == null) { this.producerTemplate = BEAN_FACTORY.getBean("producerTemplate", ProducerTemplate.class); } TaxComutePayload taxComputedPayload = this.producerTemplate.requestBodyAndHeaders(RouteConstants.TAX_COMUTE_ROUTE, taxPayloadExchange, headers, CreateReturnRAPExchange.class); } catch (CamelExecutionException expObj) { } }
Tags:
ApacheCamel
Aivivu đại lý vé máy bay, tham khảo
ReplyDeletevé máy bay đi Mỹ hạng thương gia
mua vé máy bay từ mỹ về việt nam
bao giờ có chuyến bay từ đức về việt nam
ve may bay tu nga ve viet nam
vé máy bay từ anh về việt nam
bay từ pháp về việt nam mấy tiếng
khách sạn cách ly hồ chí minh