camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jaishankar <jayashankar....@wipro.com>
Subject Re: Handle SOAP fault message
Date Wed, 30 Jul 2014 12:03:19 GMT
Sorry Williem, I don't know whether I'm right or wrong but I need to some how
handle fault message in the producer template, is there any possibility that
we can do it?

or I need a solution to the given problem

do {
invokeTransactionBegin();
invokeEmployeeModify();
invokeTransactionCommit();
} while (isContinue());
*Constants*
	ERR_EVENT_NONE = 0;
	ERR_EVENT_ELLIPSE_FAULT = 1;
	ERR_EVENT_SYSTEM = 2;
	ERR_EVENT_UNRECOVERABLE = 3;
       ALERT_INTERVAL_MINUTE = 15;
       RETRY_INTERVAL_SECOND = 60;

//Code
private boolean isContinue(Exchange exchange) {
						if (m_intErrorEventValue == ERR_EVENT_SYSTEM) {
							LOG.info("isContinue(): m_intErrorEventValue:ERR_EVENT_SYSTEM");
							invokeTransactionRollback(exchange);
							try {
								LOG.info("isContinue(): going to sleep: RETRY_INTERVAL_SECOND:" +
RETRY_INTERVAL_SECOND
										+ " m_retryCount:" + m_retryCount);
								Thread.sleep(RETRY_INTERVAL_SECOND * 1000);
							} catch (Exception ex) {
								LOG.info(" 	Thread.sleep(RETRY_INTERVAL_SECOND * 1000); Message" +
ex.getMessage());
							}
							LOG.info("isContinue(): awaken after a sleep of
RETRY_INTERVAL_SECOND:"
									+ RETRY_INTERVAL_SECOND + " m_retryCount:" + m_retryCount);
							*sendRetryAlert(exchange);*
							m_retryCount++;
							return true;
						}
						if (m_intErrorEventValue == ERR_EVENT_NONE) {
							LOG.info("isContinue(): m_intErrorEventValue:ERR_EVENT_NONE");
							return false;
						}
						if (m_intErrorEventValue == ERR_EVENT_ELLIPSE_FAULT) {
							LOG.info("isContinue():
m_intErrorEventValue:ERR_EVENT_ELLIPSE_FAULT");
							invokeTransactionRollback(exchange);
							return false;
						}
						if (m_intErrorEventValue == ERR_EVENT_UNRECOVERABLE) {
							LOG.info("isContinue():
m_intErrorEventValue:ERR_EVENT_UNRECOVERABLE");
							sendAlertMail(exchange);
							invokeTransactionRollback(exchange);
							return false;
						}
						LOG.info("isContinue(): Abort: undetermined error event");
						invokeTransactionRollback(exchange);
						sendAlertMail(exchange);
						return false;
					}
					
				*	private void sendRetryAlert(Exchange exchange) {*
						LOG.info("sendRetryAlert(): checking time");
						long lngCurrentTimeMillis = System.currentTimeMillis();
						long lngTimeDiffMS = lngCurrentTimeMillis - m_lngLastRetryAlertTimeMS;
						if (lngTimeDiffMS > ALERT_INTERVAL_MINUTE * 60 * 1000) {
							
							LOG.info("sendRetryAlert(): sending alert");
							sendAlertMail(exchange);
							m_lngLastRetryAlertTimeMS = lngCurrentTimeMillis;
						}
					}
each method is the do while loop are CXF web service caller.
If in commit returns fault response then I've to go back to
invokeTransactionBegin();
this process will continue for 15min for every 6sec it keeps calling the web
service nothing but that 3 methods in do while loop.

I accomplished this using single processor but unable to handle SOAP fault
exception or SocketTimeOutExceptions.
Please help me giving some solution ?




--
View this message in context: http://camel.465427.n5.nabble.com/Handle-SOAP-fault-message-tp5754549p5754640.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message