I am building a client-server model using Spring Integration.
I am using direct channel.
My system works as:
1.Receive request on servlet
2.Get the message channel
3.Write response in servlet response channel.
The problem arises when i receive multiple requests at the same time.
Spring Integration processes the request one by one.
It takes the first request, processes it, writes the response and then picks up the next request.My request channel is getting locked.
My servlet code is as follows:
Only one instance of the request channel is created.
private void doSpringIntegrationHandling(HttpServletRequest request, HttpServletResponse response)
ApplicationContext applicationContext = WebApplicationContextUtils
String data = readBody(request);
MessageChannel requestChannel = (MessageChannel) applicationContext
MessageBuilder<?> messageBuilder = MessageBuilder.withPayload(data).setHeader("response", response);
log.info("RESPONSE OBJECT -- "+response);
My config is as follows:
I used httpinboundgateway but faced some issues while reading the data written in request.
<int:channel id="deviceRequestChannel" />
<int:channel id="deviceResponseChannel" >
I don't want to use a queue here.Need to open a new channel for each request?
Is it possible?Please help.
Thanks in advance.