Hi,
I am working in GE.
My team is building a new request reply integation in webMethods 6.x.
We are able to see the request and corresponding response in document tracker. But when we tried to access from application, we are getting timeout exception. But we are able to see the reply for the same request which is giving timeout exception in the document trracker.
Following is the test program i am using…
Check the permissions to wm::is::Canonical::QueryPartLife::QueryPartLifeReplyDoc from the PLDB_EPDM_Service_Request_Client client group. My guess is that the client doesn’t have subscribe rights to that, which it must have to receive the event.
Thanks for your quick comments. But we are able to see the reply in document tracker after i connect to the same clientgroup and do a request reply from their.
If you have a sample test code for a request reply integration, pls post to this thread for reference…
Bad State (200-1001): Cannot register callback for a tag before registering a ge
neral callback
at COM.activesw.api.client.BrokerClient.registerCallbackForTagInternal(B
rokerClient.java:6328)
at COM.activesw.api.client.BrokerClient.publishRequestAndWaitInternal(Br
okerClient.java:2722)
at COM.activesw.api.client.BrokerClient.publishRequestAndWait(BrokerClie
nt.java:2635)
A general callback is a registered function that handles events that the client isn’t specifically waiting for (roughly). Before using request/reply, you must register a general callback. My guess on why you’re seeing this with the new test app is because the com.gepower.geep.wm.ConnectionPooling.WMPublishRequestReply has likely registered a general callback–and the second test program doesn’t appear to use that.
Double-check all your event names.
I assume WMPublishRequestReply.requestReply() has previously been debugged and isn’t a suspect in this issue.
I fixed the issue with Call Back. the next error I am seeing is…
Timeout (112-1450): The request timed out.
at COM.activesw.API.client.BrokerClient.dispatchInternalBrokerClient.ja
va:6650)
at COM.activesw.API.client.BrokerClient.dispatchBrokerClient.java:6604)
at COM.activesw.API.client.BrokerClient.publishRequestAndWaitInternal(BrokerClient.java:2738)
at COM.activesw.API.client.BrokerClient.publishRequestAndWaitBrokerClie
nt.java:2635)
Can you provide any suggestions to fix this error. i tried couple of options. But the error still exists
Error:
Timeout (112-1450): The request timed out.
at COM.activesw.API.client.BrokerClient.dispatchInternal(BrokerClient.java:6650)
at COM.activesw.API.client.BrokerClient.dispatch(BrokerClient.java:6604)
at COM.activesw.API.client.BrokerClient.publishRequestAndWaitInternal(BrokerClient.java:2738)
at COM.activesw.API.client.BrokerClient.publishRequestAndWait(BrokerClient.java:2635)
In the handleBrokerEvent method, print a diagnostic message to show what event was received. The handleBrokerEvent method will be called automatically when anything other than the reply you’re expecting is delivered.
Add this into your code to double-check the permissions:
Error:
******0000
Can subscribe: true
****b4 publish ***
*after Setting ToObject
*after publish 1
Timeout (112-1450): The request timed out.
at COM.activesw.API.client.BrokerClient.dispatchInternal(BrokerClient.java:6650)
at COM.activesw.API.client.BrokerClient.dispatch(BrokerClient.java:6604)
at COM.activesw.API.client.BrokerClient.publishRequestAndWaitInternal(Br
okerClient.java:2738)
at COM.activesw.API.client.BrokerClient.publishRequestAndWait(BrokerClient.java:2635)
at TestGen.test(TestGen.java:42)
at TestGen.main(TestGen.java:12)
Is that right? In that case, I know what the issue is. For a request/reply scenario, only the requestor should/will see the response. That is because it is delivered, not published. If you’re seeing the response in DocumentTracker that means it is being published, not delivered (that’s why I had asked how the response is being generated) and so your app will never see the response via the publisheRequestAndWait.
Yes. Your understanding is correct. I am able to publish a request event, able to see both request and response events in document tracker but not able to to see the response in the application.
Can you tell me what is the change that i need to do in the above java program that i provided to see the results back…
The change to make if this is really a request/response is to have whatever is creating the response do a reply/deliver instead of a publish.
Doc Tracker is able to see the response event presumably because you created a subscription to that event type.
If that isn’t possible, then you have some choices to make:
If the response MUST be correlated to the request, then you’ll need to store the request somewhere and subscribe to the response events that are published. Upon arrival, you’ll need to lookup the request using a data element that is in the response and then carry on with processing.
If the response can be processed independently, just create a subscription (see the API docs) and process away.
I assume you understand the difference between publishing the response (which isn’t a really “response” in the request/response sense of the term–it’s just another event that someone published) and delivering the response.
The integration that we are building is a pure request-reply integration.
In our case, request needs to be correlated to a response. We cannt process the response independently.
I checked with DeliverRequestAndWait method also. Still seeing the issue. Following is the java code:
import com.gepower.geps.common.eai.data.QueryPartLifeReplyStorage;
import com.gepower.geps.common.eai.data.QueryPartLifeRequestStorage;
import COM.activesw.API.client.BrokerClient;
import COM.activesw.API.client.BrokerConnectionDescriptor;
import COM.activesw.API.client.BrokerEvent;
import COM.activesw.API.client.*;
public class TestGen implements BrokerCallback {
public static void main(String args){
TestGen ttest = new TestGen();
ttest.test();
}
public void test()
{
try{
System.out.println(“******0000”);
QueryPartLifeRequestStorage objlQphRequest = new QueryPartLifeRequestStorage();
QueryPartLifeReplyStorage objlQphReply = new QueryPartLifeReplyStorage();
QueryPartLifeReplyStorage objlQphReplyFinal = null;
String strStatus = null;
String slStatus = null;
String temp = null;
BrokerClient client = new BrokerClient(“3.209.5.12:6849”,
“Broker #1”, null, “PLDB_EPDM_Service_Request_Client”, “SCMT”, null );
BrokerEvent document = new BrokerEvent(client,“wm::is::Canonical::QueryPartLife::QueryPartLifeRequestDoc”);
objlQphRequest.PART_TYPE_ID = “GTTBRG001”;
objlQphRequest.PART_TYPE = “BUCKET STAGE 1”;
objlQphRequest.PART_SN = “C1SB083003”;
objlQphRequest.PART_DWG = “103E5592P001”;
document.fromObject(objlQphRequest);
System.out.println(“Can subscribe: " + client.canSubscribe(“wm::is::Canonical::QueryPartLife::QueryPartLifeReplyDoc”));
System.out.println(”****b4 publish ***" );
// document.toObject(objlQphReply);
System.out.println(“*after Setting ToObject” );
document.setTag(client.makeTag());
client.registerCallback(this, null);
// boolean bCallBackflag = handleBrokerEvent(client, document, this);
// System.out.println(“bCallBackflag” + bCallBackflag);
// client.publish(document);
System.out.println("after publish 1" );
BrokerEvent replyEvent[] = client.deliverRequestAndWait(client.getClientId() ,document, 60000);
System.out.println(“after publish and wait”);
for( int i = 0; i < replyEvent.length; i++) {
if (replyEvent[i].isNullReply()) {
/ process null reply /
System.out.println(i + ": " + “Getting null reply”);
} else if (replyEvent[i].isErrorReply()) {
/ process error reply /
System.out.println(i + ": " + “Getting Error reply”);
} else {
/ process reply */
System.out.println(i + “: " + “processing replies”);
}
}
System.out.println(”****replyEvent[0] **" + replyEvent[0].getBaseTypeName());
} catch (Exception me) {
me.printStackTrace();
}
}
public boolean handleBrokerEvent(BrokerClient aEvent, BrokerEvent aBroker, Object aObject)
{
try {
if (aBroker.isNullReply()) {
/ handle null reply /
System.out.println(“Null reply received”);
} else if (aBroker.isErrorReply()) {
/ handle error reply /
System.out.println(“Error reply received”);
} else {
/ process the event */
System.out.println(“Processing the event”);
}
return true;
} catch (Exception ex) {
System.out.println(“Exception message” + ex.toString());
return true;
}
}
}
Output:
******0000
Can subscribe: true
****b4 publish ***
*after Setting ToObject
*after publish 1
Timeout (112-1450): The request timed out.
at COM.activesw.API.client.BrokerClient.dispatchInternal(BrokerClient.ja
va:6650)
at COM.activesw.API.client.BrokerClient.dispatch(BrokerClient.java:6604)
at COM.activesw.API.client.BrokerClient.publishRequestAndWaitInternal(Br
okerClient.java:2738)
at COM.activesw.API.client.BrokerClient.deliverRequestAndWait(BrokerClie
nt.java:2683)
at TestGen.test(TestGen.java:43)
at TestGen.main(TestGen.java:12)
I am seeing the same error which i saw with PublishRequestAndWait. In the error trace, I am seeing that evendeliverRequestAndWait is also calling the same method that PublishRequestAndWait called. The method that is called is “publishRequestAndWaitInternal”.
Really appreciate if you can change the code that i have provided in this comments if possible and provide which i can try…
The issue does not exist on the publisher side of the code–it’s on the responder. What is the code that is creating the response? Is it an IS FLOW service? Is it Java code? I think that’s where the answer now lies.