camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vknfh3 <>
Subject Concurrency issue with SEDA component
Date Mon, 21 Apr 2014 23:31:12 GMT

I have been facing concurrency issues with SEDA component when using it for
parallely processing 200 or more JSON Messages. Our application should be
able to process and save at least 200 JSONS at a time from each user
simultaneously. The SEDA component route seems to be working fine when only
one user is issuing 200 JSON requests(which will be enclosed in a
JSONArray). I'm running into issues when another user is hitting the same
SEDA route at the same time when the old request from other user is still in
progress. Due to this the output JSON messages are being duplicated and in
some instances getting more JSON messages back than expected!!

Before using SEDA component I tried using split and parallellProcessing and
I ran into similar kind of concurrency issues.
Here is what I have:

				.setProperty(SupplyItemRoutesConstants.JSON_ARRAY_MSG, body())
				.process(new Processor() {
					public void process(Exchange exchange) throws Exception { 
						List<JSONObject> supplyItemList = (List<JSONObject>)
						if(!supplyItemList.isEmpty() || supplyItemList.size()!=0){
							JSONObject sItem = supplyItemList.get(0);   //Get the first element
from the List
							exchange.getOut().setBody(sItem); //set the supplyItem as body to the
				.process(new SupplierNumberProcessor()) 
				.enrich(SupplyItemRoutesConstants.GET_SUPPLIER_GLN_ENDPOINT, new
				.split(simple(SupplyItemRoutesConstants.BODY_STRING), new

from("direct:savesupplyitem")    //complex route with lot of external
service calls and calls to other camel enpoints. This route also has lot
processors and aggregators. All the routes that this endpoint calls are
"direct" end points
    . to(some complex processing and saving to database)

I have uploaded the code for the above route (direct:savesupplyitem) as
separate file for your reference:

Do I need to do anything to make it work for multiple users (more than one
user will call the seda endpoint simultaneously)? Am I missing something
here ? Please suggest.


View this message in context:
Sent from the Camel Development mailing list archive at

View raw message