JMS and advanced Queues - how to dequeue?

Hi,
I've recently built a MDB that listens to an Oracle Queue (9.0.4) via JMS . Everything works fine, the only thing is that the rows that have been enqueued are not deleted (dequeued) from the queue table once the MDB has picked them up.
This only causes a problem when the database re-starts as the MDB picks up all the messages again. And also is a problem as the table will keep growing with all the messages.
Can you tell me what I should do to dequeue the messages? Should this be a trigger of some sort or is there something I can do from within the bean to dequeue the message once it has been consumed? Or is there another way of handling this?
Appreciate your help.
Cheers.

Hello,
Great! I need that solution :)
Can you point out how you connected the MDB to the AQ? What software or adapter did you use?
I have the vice versa problem.
The MDB always deletes the message in the queue table, but a rollback never works.
Did you enable transactions by the following settings in ejb-jar.xml:
<container-transaction >
<method >
<ejb-name>MyMdb</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
I use BEA to deploy the MDB and Dips xa-compliant StartupClass package to register the AQ Connection Factory to in the JNDI tree.
Regards
Thomas

Similar Messages

  • Using JMS and Advanced Queuing within forms.

    I am wondering if anyone can forsee problems with embedding a javabean inside a form that:
    listens to an Oracle queue.
    Do you think there would be some type of problem with a connection factory trying to create a connection and a session from within forms using JDBC?
    Thanks in advance

    Sandu,you are right.
    A Forms timer with status polling is a good and stabil solution .
    But we are connected on a database and a polling of a database event - Job is finished, or a reply received in a Queue -
    is always a network traffic and overhead when we use polling times < 1 min ..
    It would be also a good solution and interesting feature of Forms that the database event sends a message to the waiting client (process ?) ..

  • Nested Tables and Advanced Queues- Please Help.

    How do i work with NestedTable type and Advanced Queue.
    I have done the following
    I have Oracle 8.1.7 enterprise edition.
    create type myType as TABLE OF varchar(32);
    create type myObject as OBJECT (
    id int,
    myt myType);
    DECLARE
    BEGIN
    dbms_aqadm.create_queue_table(
    queue_table => 'my_queue_table',
    multiple_consumers => TRUE,
    queue_payload_type => 'myObject',
    compatible => '8.1.3'
    END;
    The Nested Table and Object are created successfully.
    but the queue is not created.
    I get the following message.
    DECLARE
    ERROR at line 1:
    ORA-22913: must specify table name for nested table column or
    attribute
    ORA-06512: at "SYS.DBMS_AQADM_SYS", line 2012
    ORA-06512: at "SYS.DBMS_AQADM", line 55
    ORA-06512: at line 3
    I know how to specify the nested table storage clause for
    create table statement, but there is no provision for
    it in the create_queue_table procedure.
    Any help will be greately appriciated.
    i have already created and tested aqs with simple data types,
    also i have created simple tables with nested table type
    elements.
    but the combo of Nested tables and AQ is not working.
    thanks in advance.

    Hi Francois. Thank you very much for your reply, but it seems that i still get errors. So let me tell what i have done.
    As you suggested me: i have done a block based on a sub-query for the nested-table:
    'select courses from department where name= :department.name'.
    In the master block(department) i have the when-new-record-instance trigger:
    Declare
    LC$Req varchar2(256);
    Begin
    LC$Req := '(select ns.courses from table
    ( select courses from department where name = ''' || :DEPARTMENT.name || ''' ) ns )';
    Go_block('block11');
    Clear_Block ;
    Set_Block_Property( 'block11', QUERY_DATA_SOURCE_NAME, LC$Req ) ;
    Execute_query ;
    End ;
    Now the errors i receive, this time in the runtime mode are:
    - FRM-41380: Cannot set the blocks query data source
    -FRM-41003: This function cannot be performed here.
    Since it seems that you know how to work with the nested table i would really appreaciate your help. I am new in the nested table and if you could give an ex with my tables it would be great.
    Thank you in advance.

  • Advanced Queuing for Oracle / Dequeue failed

    Hi *,
    I'm using Oracle Advanced Queuing and OC4J with some MDBs. Unfortunately sometimes I have following exception:
    03-05-21 10:29 Error listening to 'USER_QUEUE'
    oracle.jms.AQjmsException: JMS-120: Dequeue failed
         at oracle.jms.AQjmsError.throwEx(AQjmsError.java:283)
         at oracle.jms.AQjmsConsumer.dequeue(AQjmsConsumer.java:2034)
         at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:981)
         at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:918)
         at oracle.jms.AQjmsConsumer.receive(AQjmsConsumer.java:834)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:905)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797)
         at java.lang.Thread.run(Thread.java:479)
    All messages hang in my queue with READY state. I really don't know what is happening.
    I have observed that when I run my MDB, but on the different machine, one message is consumed and the same exception arises.
    Why Oracle cannot run dequeue process correctly?
    best regards
    Maciek

    We had similar problems. Mostly the cause was incorrect message type (other than AQ$_JMS..., i. e. ancestor of "message" class) or incorrectly filled body of a message. For example, there seems to be a bug in AQ$_JMS_TEXT_MESSAGE object: you have to set at least one of varchar2 or CLOB in body of message. Otherwise, dequeue will fail, JMS assumes there is some text inside.
    We are using 8i and 9i databases and messages are created using plain constructors (not methods from 9i, since code has to run on either version). I cannot recall any troubles using methods from 9i during researching, but there might be a bug somewhere.
    Myrra

  • PHP and Advanced Queuing

    I am a newbie with AQ. We use PHP for our middle tier. Database is Oracle 9i. What we would like to do is to let our middle tier know of some data changes. Has anyone implemented this in PHP? For enqueuing, do I use HTTP notification? How do I dequeue that message using PHP? Please help.

    I am afraid Oracle AQ interfaces has not been directly implemented in PHP. Oracle AQ provides lots of programmatic interfaces: PL/SQL, OCI/OCCI, Java Message Service and Servlet, and VB interfaces. The most desirable way is to wrap the OCIAQ* family functions in a PHP extension.
    Alternatively, you can use AQ's SOAP interfaces in PHP, or turn to Java for this part:)

  • How to stop listening on advanced queue

    hi,
    i created a java application that listens to an oracle advanced queue then automatically dequeues a messsage after listening. I've set my listen time-out to be the maximum integer value because i don't know when exactly when other applications will enqueue messages.
    the problem is when i attempt to shutdown the server, my application is still listening to the advanced queue.
    i want to find a way to for the LISTEN to stop whenever i perform a certain event, for example, i want shutdown my server. does oracle advance queue have that kind of functionality? stopping the LISTEN?
    Thanks very much
    Chesca

    Hi Chesca,
    we recently experienced the same problem.
    Instead of "resolve" it, we tried to "avoid" it.
    Our solution is based on 2 legs:
    1) a "not-infinite" wait time, let's say 300 secs (5 mins)
    2) an (outer) "infinite-loop" that relaunch the (inner) LISTEN method, catching the appropriate exceptions, and testing for the "state" of the queue
    Hope this could help you.
    Bye
    Paolo

  • Sample Message Driven Bean using Oracle Advance Queuing

    Hi,
    Can someone please provide me with sample MDB using Oracle Advance Queuing to Enqueue & Dequeue messages?
    Thanks

    Write your email Id .....I have got a test case which basically enqueus and dequeues the messages using Oracle9i AQ..
    --Venky                                                                                                                                                                                                                                                                   

  • Weblogic JMS bridge between Weblogic and oracle Advanced Queue

    Hi,
    We are facing some issues when we are trying to integrate with Oracle AQ JMS through Weblogic.
    We have configured a Foreign AQ server which points to the oracle Advanced Queue and we are trying to create a Weblogic JMS bridge between AQ and weblogic. The bridge works perfectly if create the connection factories and bridge destinations with NonTX mode. The issue is with XA mode. Also we have deployed the Resource adaper for XAResource to use XA transactions.
    No help is available for the exception on google too :)
    Following is the exception we are getting.
    <An error occurred in bridge "aqjmsbridge" during the transfer of messages (javax.resource.ResourceException: Failed to setup the Resource Adapter Connection for enlistment in the transaction, Pool = 'eis/jms/WLSConnectionFactoryJNDIXA', javax.transaction.SystemException: start() failed on resource 'eis/jms/WLSConnectionFactoryJNDIXA': XA_OK
    javax.transaction.xa.XAException: method start should not be called on weblogic.transaction.internal.IgnoreXAResource
    at weblogic.jms.foreign.IgnoreXAResourceImpl.start(ForeignAQIntegration.java:260)
    at weblogic.connector.security.layer.AdapterLayer.start(AdapterLayer.java:513)
    at weblogic.connector.transaction.outbound.XAWrapper.start(XAWrapper.java:466)
    at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1184)
    at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1117)
    at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:275)
    at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:516)
    at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:443)
    at weblogic.connector.transaction.outbound.XATxConnectionHandler.enListResource(XATxConnectionHandler.java:118)
    at weblogic.connector.outbound.ConnectionWrapper.invoke(ConnectionWrapper.java:218)
    at $Proxy59.receive(Unknown Source)
    at weblogic.jms.bridge.internal.MessagingBridge.processMessages(MessagingBridge.java:1427)
    at weblogic.jms.bridge.internal.MessagingBridge.beginForwarding(MessagingBridge.java:1002)
    at weblogic.jms.bridge.internal.MessagingBridge.run(MessagingBridge.java:1079)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    .).>
    Will appriciate any help for the above.
    Thanks and Regards,
    Navin

    Maybe this if of any help:
    - Re: Help with creating AQ JMS
    or
    - Re: AQ Weblogic integration - JMS-107: Operation not allowed on Connection

  • How to automate checking status of Replication agent and Replication queue in CQ5

    As part of monitoring the status of replication agents and replication queue, is it possible to automate the checking process?
    We can check them from GUI, but from a monitoring perspective we are loking for a mechanism where the status can be checked continuously and we are alerted whenever there is some issue.
    1. Check status of replication agent (enabled/disabled)
    2. Check status of replication queue (if the queue is blocked)
    Thanks in advance
    nkrao

    you can pull the queue from the page the same way the UI gets the list
    in the table:
    curl -u admin:admin
    "http://localhost:4502/etc/replication/agents.author/publish/jcr:content.queue.json?agent=p ublish"
    and then use a shell library like ticktick.sh to parse the json
    response. A sample of how to get the bundles loaded and installed from
    CQ using the ticktick library can be found here
    https://github.com/kristopolous/TickTick
    http://ruben42.wordpress.com/2012/04/24/using-ticktick-sh-to-parse-json-responses-from-ado be-cq5-5/

  • Request for Comments and Experiences with Streams Advanced Queuing

    Hi,
    I would like to get some feedback about what your experiences with Streams Advanced Queuing. What do you like about it? What don't you like? How do you use it? What features would you love to see in it? Please post to the forums. Thanks!

    I love the new homeless Instant Client! I wish we had it years ago. Some comments:
    1) The MS ODBC administrator GPF's (blows up) when trying to configure a new data source using the new Oracle IC drivers. Have to hand-edit the registry.
    2) I heartily agree with the request that the new client install without requiring the normal Oracle installer. It's just too bloated for easy deployment. I'd rather hand install the files than to have to use that. Also, .zip not .jar please.
    3) Need better documentation on the connection string options. It took me 3 weeks to figure out that what used to be scott/tiger@mydb is now scott/[email protected]:1524/mydb.xxx.yyy (it's looking for the GLOBAL_NAME, not the SID and TNSPING won't show you that! Doh!)
    4) Please let us specify a range of ports (e.g. :1521-1524) and let it figure out where the SID is on that machine. We move ours around and don't want to update hundreds of clients with hardcoded command lines.
    5) Maximum backward compatibility, please! It's not easy moving all those Oracle apps to 8.1.7.4+ databases, yet, but my old OCI client programs should not have to care. I don't want to have 2 SQL*net driver stacks on my PC's.
    Thanks -- I'll be watching for new features.

  • Dequeue from Advanced Queue

    Hi All,
    I have used the DBMS_AQ package provided dequeue functionality for dequeuing msgs from my advanced queue. Now there is a job which dequeue the items from this queue and sends out email. Now what is happening is the job picks up an item from the advanced queue for dequeuing and sends out email, but the item which is picked up still remains in the queue and is not dequeued. As the job runs every minute and polls the queue, it again picks up the same queue item and sends the email. This process repeats for 5-6 times and then the queue message expires. My requirement is that, the job should dequeue the item from the queue and just send email once. Please can anyone suggest what could be the solution to this problem?

    10g is not a version number it is a marketing label that applies equally to 10.1.0.2 and 10.2.0.4 and a lot of versions in between.
    That said I know this demo I wrote works in all versions of 10.2:
    http://www.psoug.org/reference/aq_demo1.html
    Compare it to what you are doing.

  • How JMS and MDB works?

    Hi,
    I am writing a portion of a J2EE application and would like to perform asynchronous processing. Im new to JMS. Following are some questions i have:
    - How does JMS process message, queue and MDB? I mean when a message is send to a queue, how does it know which MDB should be receiving the message?
    - Im using JBoss which has JMS support. Under normal circumtances, is it all right to use the default queue that comes with the JMSProvider (i.e. the application server in this case)? Or should we write some other codes for create queue?
    - In terms of design, should one MDB only performs a single function? The reason for this is that a MDB seems to only have a single 'onMessage' method?
    - The following is what my application tries to achieve: Servlet will call a method in a StatelessSessionBean. SessionBean perform first some processing. And since part of the process does not require to be done at the same time, i would like it to happen asynchronously. I actually intend to have that part of the processing happens in an MDB. Is that the correct way to use JMS & MDB? How else could i perform asynchronous processing?
    Thanks much.
    Veny

    - how does it know which MDB should be receiving the message?
    The MDB is configured to consume messages from a specific queue in one of the J2EE xml files (Haven't written them in a while so can't be sure which one).
    - is it all right to use the default queue that comes with the JMSProvider
    I wouldn't, because your queue names won't reflect the job they are doing.
    Create some new queues by updating your jms providers config files.
    - In terms of design, should one MDB only performs a single function
    This is a reasonable approach to take, although it's sometimes OK to have an MDB act like a controller and delegate to handler classes (possibly session beans) based on the message type. The latter approach is suitable only for small apps as it's far less configurable / scalable (e.g. you can't say I want 10 MDB instances to processing message X and 50 MDB instances to process message Y).
    - Is that the correct way to use JMS & MDB
    Yes, that's pretty much it, although I would still delegate the work to a handler class. It will make if easier to test and more portable.

  • JMS Interface to Advanced Queuing

    I want to use the Advanced Queuing features from Java. The rub: I am doing a queue-to-queue message transfer between JMS servers (Swift & Oracle).
    What would help me get the the next step is this: I am looking at the SampleUtilities.java file included with the Java Message Service sample programs available at http://java.sun.com/products/jms/docs.html
    In this class, there is a method called getQueueConnectionFactory() that returns a QueueConnectionFactory object. I need to add provider-specific code in this method.
    Any ideas what the provider-specific code should be? If there is anybody who as made the standard set of sample programs work, perhaps you could post your changes to SampleUtilities.java?
    Thanks in advance.
    -best-darr-

    It's important to note the difference between "Oracle9i" and "Oracle9iAS". Much of the AQ documentation is in the Oracle9i documentation set, not the Oracle9iAS set. That is, it's documented in the database documentation, not the application server documentation.
    There is certainly some in the AS documentation, but I had to see the database documentation to get some details.

  • How to delete the data in update queue and delta queue for Queued delta?

    Dear BWers,
    How do i delete the delta queue and update queue data before i fill the setup tables for a extraction based on Queued delta. Please help.
    Thanks
    Raj

    Hi Raj,
    I think you need some ground work for the LO extraction same as others here. Please read the 3 blogs expliciltly created for LIS by Robert Negro.
    /people/sap.user72/blog/2004/12/16/logistic-cockpit-delta-mechanism--episode-one-v3-update-the-145serializer146
    /people/sap.user72/blog/2004/12/23/logistic-cockpit-delta-mechanism--episode-two-v3-update-when-some-problems-can-occur
    /people/sap.user72/blog/2005/01/19/logistic-cockpit-delta-mechanism--episode-three-the-new-update-methods
    As well, the OSS 380078 would clear your doubts reagrding the the BW QUEUE mainatinance. 
    Please let me know if these material has been suffecient enough.
    regarda,
    raj

  • Oracle JMS Advanced Queuing

    Problems with Oracle JMS Advanced Queuing
    Hello,
    We have build an application using Advanced Queuing (database version 10.2.0.1.0). Everything works fine using PL/SQL. But when we try to send in messages through the Oracle JMS interface messages with less then 4000 bytes are stored in the queu table but the content of the message is not stored in one of the user data attributes.
    Messages larger then 4000 bytes result in the following error:
    oracle.jms.AQjmsException: JMS-204: Er is een fout opgetreden in de AQ JNI-laag.
    at oracle.jms.AQjmsError.throwEx(AQjmsError.java:311)
    at oracle.jms.AQjmsProducer.enqueue(AQjmsProducer.java:1323)
    at oracle.jms.AQjmsProducer.send(AQjmsProducer.java:692)
    at oracle.jms.AQjmsProducer.send(AQjmsProducer.java:465)
    at nl.detailresult.aqadapter.test.OracleQueueSendTextMsgTest.testOracleQueuePlus4000(OracleQueueSendTextMsgTest.java:125)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    [Linked-exception]
    oracle.jms.AQjmsException: ORA-00942: table or view does not exist
    As far as I can see we have done everything according to the books but does anyone have a clue what we might have missed?

    Hi,
    Have you found a solution to this? I am running into similar issue with SOA Suite using OJMS queues.
    Regards,
    Rajesh

Maybe you are looking for

  • No sound in Keynote

    Today, when I play my slideshows, my embedded video clips and tunes cannot be heard. I have used Keynote for years and never had this problem. These slideshows previously sounded fine. My computer volume is up. Other applications (iTunes) sound fine.

  • Problem with bind method of Visibroker 4.5 and 6.5 for java

    I am facing following problem when I am trying to compile my CORBA application using javac. bind (java.lang.String,java.lang.String,java.lang.String,org.omg.CORBA.BindOptions) in com.inprise.vbroker.CORBA.ORB cannot be applied to (java.lang.String,ja

  • Preloader export to frame scenario

    I decided to move my preloader to the main timeline of my SWF instead of it's own scene in an attempt to simplify things. As before, everything works fine other than the blank white screen for about 15 secs and then the progress bar hitting the scene

  • Movie disappeared!

    I need help ASAP. I have been working on a presentation for tonight. All of clips, titles, transitions, audio were perfect. I wanted to run it one more time. The picture viewer is blank! All of clips, etc are on the clip viewer and the time line, but

  • How do I get Ovi Suite to Automatically Delete Pho...

    Try as I might, search on Google as I did, I could not find any information on this! On my previous, older Nokia phones, there is an option on PC Suite for me to do this. Is this no longer possible for Ovi Suite? Help!