Oracle® Fusion Middleware User's Guide for Oracle B2B 11g Release 1 (11.1.1.6.0) Part Number E10229-07 |
|
|
PDF · Mobi · ePub |
This chapter contains the following topics:
For more information about the Instance Message API, InstanceMessageUtil
class, see Oracle Fusion Middleware B2B Instance Message Java API Reference.
Instance Message Java API is a Java API provided in Oracle B2B to retrieve runtime data that is exchanged between Trading Partners.
Some Instance Message Java API use cases include:
Resubmitting from a back-end application
Checking the status for a particular order number
Payload introspection by a back-end application
Checking the remaining retries for the message
Checking the wire message of the payload
Instance Message API queries the runtime data and provides results in the form of Instance data for various criteria. Instance Message API is a java wrapper on top of Instance Message View which encapsulates both business and wire messages.
Note:
When using this API, you must set additional libraries as part of the classpath in addition tob2b.jar
and weblogic.jar
or wlthint3client.jar
.Instance Message API Query Options
The Instance Message Java API enables you to retrieve the instance messages based on the following criteria:
Agreement name
Control number, group control number, transaction control number, Trading Partner name, and document type
Date range and Trading Partner
Date range, direction, and Trading Partner
Message ID
Message state
Protocol message ID
Trading Partner
Trading Partner and direction
Trading Partner and document type
Trading Partner and message state
Xpath expression (can be evaluated on one or two XPath expressions)
XPath value (can be evaluated on one or two XPath expressions)
Conversation ID
For more information about the Instance Message API, see Oracle Fusion Middleware B2B Instance Message Java API Reference.
You can write your logic based on the out put of
Vector messages = (Vector) imUtil.getInstanceMessagesForTP("GlobalChips")
as shown in Example 25-1.
Another similar exposed method is getInstanceMessagesForMsgId(String messageId)
. All of the methods are documented in Oracle Fusion Middleware B2B Instance Message Java API Reference.
Example 25-1 Retrieval based on Trading Partner Name
import java.util.Vector; import oracle.tip.b2b.utility.InstanceMessageUtil; public class MyInstanceData { public static void main(String[] args) throws Exception { InstanceMessageUtil imUtil = new InstanceMessageUtil(); Vector messages = (Vector) imUtil.getInstanceMessagesForTP("GlobalChips"); System.out.println(messages.size()); } }
See the following topics for troubleshooting information:
If the query returns a large number of messages then the weblogic.socket.MaxMessageSizeExceededException
may occur.
To recover from this issue, increase weblogic.MaxMessageSize
, and pass -Dweblogic.MaxMessageSize=100000000
in the client command line. This parameter setting will allow you to receive 100 MB messages.
For example:
java -cp .:$ORACLE_HOME/wlserver_10.3/server/lib/wlthint3client.jar:$SOA_HOME/ /soa/modules/oracle.soa.b2b_11.1.1/b2b.jar -Dweblogic.MaxMessageSize=100000000 TestInstanceMsg
Rather than return the payload itself, a large inbound or outbound payload will return as a reference to the location of the payload.
For example:
/tmp/GlobalChips_1_custnonxml_largepayload.dat@9844C4341297D3EB7B60000011A0CC9D .dat
See Appendix A, "Handling Large Payloads" for more information about how Oracle B2B handles large payloads.
If while using weblogic.jar
and executing queries remotely you may see classpath issues for Oracle WebLogic Server, and the java.lang.ClassNotFoundException:weblogic.security.subject.AbstractSubject
exception.
To recover, execute queries using wlthint3client.jar
.
For example:
java -cp .:$ORACLE_HOME/wlserver_10.3/server/lib/wlthint3client.jar:$SOA_HOME/ /soa/modules/oracle.soa.b2b_11.1.1/b2b.jar TestInstanceMsg