Consultor Eletrônico



Kbase P16751: Inconsistent behavior of request/reply with servlets
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   15/10/2008
Status: Unverified

FACT(s) (Environment):

SonicMQ 4.x
Progress 9.x

SYMPTOM(s):

Inconsistent behavior of request/reply with servlets

Customers problem description:

Our solution runs perfect as long as we
have one requestor and one replier. But as soon as we have two requestors our solution doesn't work properly anymore. The replier
seems to be sending the answer to both requestors find out where the problem is we started at the basic. In

C:\Programme\SonicMQ402\samples\TopicPubSub\RequestReply we modified the program Requestor.java to Requestoredp.java.
Instead of Replier.java we use the Progress program areply.p. With this programs, we do not have any problems. For example:

start areply.p
start a first session: java Requestoredp, enter abc1
start a second session: java Requestoredp, enter abc2
in areply.p answer to abc1, the answer goes to the first session
in areply.p answer to abc2, the answer goes to the second session

We then modified Requesteredp.java to tester.java to become a version which runs as a servlet in a Browser. Our Servlet-Runer is
Apache Tomcat. For example:

start areply.p
start a first browser and call the servlet http://localhost:8080/examples/servlet/tester, enter
start a second browser and call the servlet http://localhost:8080/examples/servlet/tester, enter
in areply.p answer to the first call, the second browser receives the answer and the first browser a part of it (it seems like that)

If we do the same thing in a mixed configuration (one java client, one browser client), then it works fine as well. But as soon as we have
more than one browser client, the solution doesn't work properly any more.

CAUSE:

Servlet coding error. Output stream to second browser was used for
1. and 2. acknowledgment

FIX:

Making sure within the servlet code that the right output stream to the right browser is used solved the problem.
The working example servlet code can be found in the call directory.