Hi,
Thanks for your reply and your patience.
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…
Thanks,
Babu
#webMethods#broker#Integration-Server-and-ESB#Universal-Messaging-Broker