Search code examples
spring-integrationspring-integration-dslspring-integration-amqpspring-integration-awsspring-integration-mqtt

concurrent consumers in context to spring integration


In spring integration application, I am using concurrent consumers to consume and process the multiple messages at a time. In my application, I configured all beans to a singleton. I am assuming if I am going to parallelize the processing by using the concurrent consumer's, multiple messages entered into same integration components. Does it leads to data collision between two objects?


Solution

  • Does it leads to data collision between two objects?

    No, that doesn't mean. If you don't do any state management in your components, then the is not going to be any collisions. Just because one thread can perform only one task at a time. So, if you use the same component in different threads to perform stateless work, there is no any inter-thread interaction. Just because each thread get its own call stack.