How to use AQ JMS in SOA Suite 11g I am using the following docs to set up this test case. Document1 Document2 As per the first document i have created a queue table ,a queue and have started it using following commands connect / as sysdba; Grant connect, resource TO jmsuser IDENTIFIED BY jmsuserpwd; Grant aq_user_role TO jmsuser; Grant execute ON sys.dbms_aqadm TO jmsuser; Grant execute ON sys.dbms_aq TO jmsuser; Grant execute ON sys.dbms_aqin TO jmsuser; Grant execute ON sys.dbms_aqjms TO jmsuser; Create queue table exec DBMS_AQADM.CREATE_QUEUE_TABLE(Queue_table =>'arpit',Queue_payload_type =>'sys.aq$_jms_text_message',multiple_consumers =>false); create queue EXEC DBMS_AQADM.CREATE_QUEUE(queue_name =>'ankit',queue_table =>'arpit'); exec DBMS_AQADM.START_QUEUE('ankit'); Now following steps 1>Create a data source to connect to the queue created log in to Admin console Go to data sources as indicated and create a new data source. give it some qunique name such as jdbc/SampleAQJMSDataSource
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
How to use AQ JMS in SOA Suite 11g I am using the following docs to set up this test case.
Document1
Document2
As per the first document i have created a queue table ,a queue and have started it using following commands
connect / as sysdba;Grant connect, resource TO jmsuser IDENTIFIED BY jmsuserpwd;Grant aq_user_role TO jmsuser;Grant execute ON sys.dbms_aqadm TO jmsuser;Grant execute ON sys.dbms_aq TO jmsuser;Grant execute ON sys.dbms_aqin TO jmsuser;Grant execute ON sys.dbms_aqjms TO jmsuser;
Services-->Messaging -->JMS module and create a JMS module
Now as per document create a Foreign server in the JMS module
In the foreign server(JMS System Module Resource) select Foreign Server option, you need to take care of two things
1>JNDI Initial Context Factory: is essentially set to "oracle.jms.AQjmsInitialContextFactory" no need to add subdeployment.2>In the JNDI properties you have to set the jndi for your data sourcewhich should appear like this
datasource=jdbc/SampleAQJMSDataSource
Here jdbc/SampleAQJMSDataSource is the name of the data source i have used in my case to connect to the queues that i have created.
If you will check the document it corresponds to following configuration
Now there is one more settings that we need to do which the document doesn't talk about.We need to create an outbound connection pool for JMS adapter to be used in jdeveloper.
So i went to Deployment-->JMS Adapter-->configuration and Outbound connection pool and created an outbound connection pool
eis/SureshQueue as shown in the list
Now once the outbound connection pool is created go to the connection and go to properties tab
Use your schema or use opaque schema as per your business need to complete the process.Once process is complete drag a wire from bpel process to the adapter you have created so in all you composite should look like this
Further go to your bpel process and drag a drop an invoke activity and assign activity to copy input variable to the input of invoke activity so your bpel process should look something like this after completion
Now deploy the process and check this
Once you will invoke the process you might get an error like this
Specifically you will get the following error message
Error Message: {http://schemas.oracle.com/bpel/extension}bindingFaultFault ID default/AQJMS!1.0*soa_3f7f4fbd-e72e-4fdd-9820-16e30daab15c/BPELProcess1/80011-BpInv0-BpSeq0.3-3Fault Time Mar 25, 2011 1:03:34 PMNon Recoverable System Fault :<bpelFault><faultType>0</faultType><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'Produce_Message' failed due to: [Connector:199175]This ManagedConnection is managed by container for its transactional behavior and has been enlisted to JTA transaction by container; application/adapter must not call the local transaction begin/commit/rollback API. Reject event LOCAL_TRANSACTION_STARTED from adapter.". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary></part><part name="detail"><detail>[Connector:199175]This ManagedConnection is managed by container for its transactional behavior and has been enlisted to JTA transaction by container; application/adapter must not call the local transaction begin/commit/rollback API. Reject event LOCAL_TRANSACTION_STARTED from adapter.</detail></part><part name="code"><code>null</code></part></bindingFault></bpelFault>
Error Message: Fault ID reference:40011Fault Time Mar 25, 2011 1:03:34 PMNon Recoverable System Fault :Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'Produce_Message' failed due to: [Connector:199175]This ManagedConnection is managed by container for its transactional behavior and has been enlisted to JTA transaction by container; application/adapter must not call the local transaction begin/commit/rollback API. Reject event LOCAL_TRANSACTION_STARTED from adapter.". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
It took me a long time to resolve this issue.
By default when you are configuring the process from jdeveloper
a default outbound connection pool is used that is
eis/aqjms/Queue
YOu have to use only this one.
So Just go to your admin console
Go to Deployment-->JMS Adapter
Configuration_>Outbound connection pool and click on eis/aqjms/Queue
Go to properties tab and in the connection factory location specify the local jndi of the connection factory that you have created,which in our case is jms/myCF
Now update your JMS Adapter and change the jndi name in your Jdeveloper also.
Redeploy the process and test it again.
This time it should work fine.
now you can log in to database with the user and password and do a query on the table to know if the process completed successfully or not.In my case i have called it twice so i am getting a count of 2.