Skip Navigation Links | |
Exit Print View | |
Designing with Oracle Java CAPS Communication Adapters Java CAPS Documentation |
Designing with Communication Adapters
Installing the DLL and JAR Files for the COM/DCOM Adapter
To Install the COM/DCOM Adapter Files
Installing the MSMQ DLL and JNI Files
To Install the MSMQ DLLs and Runtime JNI
Streaming Data Between Components with the Batch Adapter
Introduction to Data Streaming
Overcoming Large-file Limitations
The MSMQ adapter installation includes two additional components (as well as the Enterprise Manager Plug-In) that must be downloaded and installed for the MSMQ Adapter:
MSMQ Adapter - Runtime win32 bridge DLLS Zip
MSMQ Adapter - Runtime JNI
You can download both files from the Java CAPS Suite Uploader.
Before You Begin
Before you can perform this task, the MSMQ Adapter must be installed. For more information, see Installing Additional Repository-Based Java CAPS Components in Installing Additional Components for Oracle Java CAPS 6.3.
An alternative to this procedure is to extract the ZIP file elsewhere and add each DLL file to the library path using the GlassFish Admin console.
Note - If you plan to run command line codegen against MSMQ projects, copy the above JAR file to the \compile\lib\ext folder first.
You can configure the MSMQ Adapter to roll back an outbound MSMQ message when a failure occurs in the Java Collaboration Definition (for example, failure to insert a duplicate row into a database table that is defined to have unique keys), do the following:
try { MSMQClient_1.getEwayConfiguration().setOutMSMQName( "public" ); MSMQClient_1.getEwayConfiguration().setOutMSMQShareMode( "DENY_RECEIVE_SHARE" ); MSMQClient_1.getEwayConfiguration().setOutMSMQReceiveActionCode ( "ACTION_PEEK_CURRENT" ); MSMQClient_1.connect(); MSMQClient_1.getMSMQMessage(); TestDB_1.getTEST1().insert(); TestDB_1.getTEST1().setTESTSTRING( "From JCD" ); TestDB_1.getTEST1().insertRow(); MSMQClient_1.getEwayConfiguration().setOutMSMQReceiveActionCode ( "ACTION_RECEIVE" ); MSMQClient_1.getMSMQMessage(); MSMQClient_1.disconnect(); } catch ( Exception Catch ) { MSMQClient_1.disconnect(); }
The key code items are highlighted in bold. You must also use a try/catch block to catch the exception (for this example, the error is a failed insert to database).
MSMQ Share Mode– DENY_RECEIVE_SHARE: This locks the queue so that other applications cannot open the queue in Receive mode. Until your application closes the queue, no other application can open the queue to receive the message.
MSMQ Receive Action Code– ACTION_PEEK_CURRENT: This opens the queue so you can “peek” (view) the message.