camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kishore <kishoredevarase...@gmail.com>
Subject Re: Concurrent Consumers creating duplicates
Date Mon, 16 Mar 2015 09:55:32 GMT
Here is the WMQRouter. The Ack queue is for a different purpose. we have to
change the message adding some more data and send the Ack back.


/public class WMQRouter extends RouteBuilder {
	
	public static org.apache.log4j.Logger LOG =
org.apache.log4j.Logger.getLogger(WMQRouter.class);

	public String incomingQueue;

	public String outgoingQueue;

	public String backupFolder;

	public String ackQueue;

	public String getIncomingQueue() {
		return incomingQueue;
	}

	public void setIncomingQueue(String incomingQueue) {
		this.incomingQueue = incomingQueue;
	}

	public String getOutgoingQueue() {
		return outgoingQueue;
	}

	public void setOutgoingQueue(String outgoingQueue) {
		this.outgoingQueue = outgoingQueue;
	}

	public String getBackupFolder() {
		return backupFolder;
	}

	public void setBackupFolder(String backupFolder) {
		this.backupFolder = backupFolder;
	}

	public String getAckQueue() {
		return ackQueue;
	}

	public void setAckQueue(String ackQueue) {
		this.ackQueue = ackQueue;
	}

	/**
	 * The configure method is invoked by the Camel to process the message
	 * exchanges from the incoming queue and place the processed transaction
xml
	 * to corresponding queues This method also processes the on Exception
	 * scenario wherein invoking the Error Handler and places the failure
	 * message to the Failure Queue
	 */
	@Override
	public void configure() throws Exception {

		String incomingQueue = "websphere:queue:" + getIncomingQueue();

		String outgoingQueue = "websphere:queue:" + getOutgoingQueue();

		String failureQueue = "websphere:queue:" + getAckQueue();

		String backupFolder = "file:" + getBackupFolder();

		FixParseValidator.init();

		FixProcessor fixProcessor = new FixProcessor();
		FIXAckProcessor fixAckProcessor = new FIXAckProcessor();
		FIXErrorHandler fixErrorHandler = new FIXErrorHandler();

		fixAckProcessor.setFixProcessor(fixProcessor);
		fixErrorHandler.setFixProcessor(fixProcessor);

		onException(Exception.class).process(fixErrorHandler);

		onCompletion().process(fixAckProcessor).to(failureQueue);

		from(incomingQueue).to(backupFolder).process(fixProcessor)
				.to(outgoingQueue);
	}
}
/



--
View this message in context: http://camel.465427.n5.nabble.com/Concurrent-Consumers-creating-duplicates-tp5764158p5764209.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message