on 04-28-2008 10:03 PM
Would I like to know that it can provoke that a call to an asynchronous method EJB takes so much time (1-8 seconds)?
I developed the example [Calculator|http://help.sap.com/saphelp_nw04/helpdata/en/7d/cf0c8abcc34594ba9d3bbd5dd22155/content.htm] and the calls are very fast. (ten calls to the Add method were made in 79 Milliseconds).
But when I invoke an asynchronous method EJB that was developed using the Java Proxy Generation of the Integration Builder, its invocation takes long time, between 1 and 8 seconds (each call).
What can I check to know where the problem is?
Example Calculator EJB Invoke (Very Fast):
try {
Context ctx = new InitialContext();
CalculatorHome home =
(CalculatorHome) ctx.lookup("sap.com/CalculatorEar/CalculatorBean");
remote = home.create();
float a = 1;
float b = 5;
float result;
long startTime;
long stopTime;
long elapsedTime;
for (int i = 0; i < 10; i++) {
startTime = System.currentTimeMillis();
result = remote.add(a, b);
stopTime = System.currentTimeMillis();
elapsedTime = stopTime - startTime;
System.out.println("Time: " + elapsedTime);
}
} catch (Exception e) {
System.out.println("Exception:" + e.getLocalizedMessage());
}
Example Java Proxy Generation EJB (Very Slow):
try {
Context ctx = new InitialContext();
OaMI_PortTypeHome home = (OaMI_PortTypeHome) ctx.lookup("JNDI_oaMI");
queryOutRemote = home.create();
//Set parameters for the proxy call (parameter of ejb method)
...
queryOutRemote.$messageSpecifier();
float result;
long startTime;
long stopTime;
long elapsedTime;
for (int i = 0; i < 10; i++) {
startTime = System.currentTimeMillis();
queryOutRemote.oaMIMethod(parameter);
stopTime = System.currentTimeMillis();
elapsedTime = stopTime - startTime;
System.out.println("Time: " + elapsedTime);
}
} catch (Exception e) {
System.out.println("Exception:" + e.getLocalizedMessage());
}
Thanks, and Regards,
Roger Solano
Roger,
What does the OAMIMethod do exactly ? If this method causes long runtime, maybe you could add elapsed time logging/tracing to see which part(s) of it take(s) long time to perform ...
It won't help you a lot, but this could be a good starting point ...
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Chris,
The EJB was generated by Java Proxy Generation from an outbound asynchronouse message interface using the Integration Builder.
The classes and methods ares generated automatically by Java Proxy Generation so the oaMIMethod
send one message from J2EE to SAP XI.
If the interface from which the proxy was generated is an asynchronous interface, should not the oaMIMethod method be executed also in asynchronous mode?
Should not the method once invoked for his execution return immediately?
thank you in advance,
Regards,
Roger
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.