For a service i initially started using an Oracle AQ Adapter for dequeueing messages from an Oracle AQ. This works fine, only when processing of the message fails, i have to rollback the dequeue operation. Although that Oracle AQ Adapters do support XA, it do not see a way (documented in oracle docs, google etc) to force the rollback of that dequeue operation. Is it possible to rollback a dequeue operation using the oracle AQ Adapter?
Secondly i tried it using an JMS Adapter. Herefore i created within a existing JMS Module a foreign server (WNSForeignServer) with
- JNDI Initial Context Factor; oracle.jms.AQjmsInitialContextFactory
- JNDI Properties: datasource=jdbc/CDB
I created a new connection factory in WNSForeignServer: WNS_BERICHT_CF with
- Local JNDI Name: aqjms/XAQueueConnectionFactory
- Remote JNDI Name: XAQueueConnectionFactory
I created a new destination in WNSForeignServer: wns_bericht_q with
- Local JNDI Name: jms/aq/wns_bericht_q
- Remote JNDI Name: Queues/WNS_BERICHT_Q
Restarted the managed server
WNS_BERICHT_Q is an existing queue which is also used by the configured (and working) AQ Adapter.
In my composite i added a JMS Adapter using Oracle Advanced Queueing as JMS Provider and Consume Message as operation Type.
The Destination Name is jms/aq/wns_bericht_q (visible when using the browse option)
When putting messages on the queue the message is retrieved when using the Oracle AQ Adapter, but ik keep failing retrieving the messages using th JMS adapter.
Any help/ideas is appreciated ! (in other words; HELP! ;-) )
Regarding the AQ stuff.
If you create an empty / aysnc process the dequeueing takes in a different thread and the rest of the processing in a different thread.
So the transactions remain different.
If you need to perform some activity after dequeue and then rollback the message back to the queue (if some error occurs), then make the process as sync.
You would need to modify the wsdls to make so.
Yep just found that out myself.. thanks anyway!
Changed/added the properties bpel.config.transaction=requiresNew and bpel.config.oneWayDeliveryPolicy=sync and
throw a rollback exception when the transaction needs to be rolled back.