Duplicate messages for unresponsive EPR
Issue
-
Create a simple web service which will sleep for 1 minute. The intention is to simulate an external web service with slow response time. The web service application (
dummyWS) should be deployed onto any JBoss EAP 5 instance (use ports-02), and bind to the address,http://127.0.0.1:8280/dummyWS/SlowWS?wsdl -
Create a SOA-P 5.1 cluster with two nodes: node1 (
ports-default) and node2 (ports-01). Start the cluster. -
Deploy the JBM queues using the attached
"jbm-service.xml"file to both nodes. -
Deploy the ESB service
"SlowESBService.esb"to both nodes. If you look at"jboss-esb.xml"file, the service implementation is something like the following:
HTTP Gateway -> Static Router -> JMS Queue -> SOAP Proxy -> Slow Web Service
In this case,"synchronousTimeout"for the HTTP gateway has been set to 10 seconds to simulate the unresponsive EPR error. -
Execute the Java client
"SendWSMessage.java". You will notice that even though the client only sends one message, in fact two messages are generated by ESB and sent to the external web service.
Test 1: Single Request, HTTP Gateway synchronousTimeout = 10 seconds, JMS Listener maxThreads = 20
Result: Even though only one SOAP message is sent from the client, two messages are sent to web service (the message has been duplicated). Since the web service call takes 1 minute, as expected, after 10 seconds, it throws the following error:
15:06:36,919 ERROR [[TroubleTicketGatewayListener]] Servlet.service() for servlet TroubleTicketGatewayListener threw exception
org.jboss.soa.esb.listeners.message.ResponseTimeoutException: No response received for service [Gateway:TT].
Test 2: Single Request, HTTP Gateway synchronousTimeout = 100 seconds, JMS Listener maxThreads = 20
Result: The request has been processed successfully. Only one message is sent to the web service. This is the correct behavior.
Test 3: 200 concurrent requests (using JMeter), HTTP Gateway synchronousTimeout = 100 seconds, JMS Listener maxThreads = 20
Result: With maxThreads set to 20, the service is able to process 20 messages at a time. For the first few requests, there are no duplicate messages, because the requests can be completed before the timeout (60 sec < 100 sec). For the subsequent requests, the messages are duplicated (each message is sent twice to the web service). I have attached the console output from the web service application for your reference (filename: 200-esb-test-3.log)
-
We would like to avoid duplicate messages. We are okay with failed messages due to timeout, because we can resubmit the messages. But duplicate messages are not acceptable because they will cause duplicate entries in the external system which will be harder to recover.
-
If the client sends a request to access the service and if the request processing time is exceeding 30 sec, then socket timeout exception was being send to client and the same request was getting re-submitted to application (auto-retry).
Environment
- JBoss SOA Platform (SOA-P)
- 5.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
