Dequeue a text message

Hello everyone,
DB version : 11.2.0.1.0
I'm able to add a text message on an AQ queue, but I'm not able to dequeue it from java.
When I run the dequeue method, it waits ... it doesn't get any message in, even if new messages are being put on the queue.
What am I missing ?
Creation of the AQ queue:
EXEC DBMS_AQADM.STOP_QUEUE('textmessage_queue');
EXEC DBMS_AQADM.DROP_QUEUE('textmessage_queue');
EXEC DBMS_AQADM.DROP_QUEUE_TABLE('queue_textmessage_table');
EXEC DBMS_AQADM.CREATE_QUEUE_TABLE (queue_table => 'queue_textmessage_table', queue_payload_type => 'SYS.AQ$_JMS_TEXT_MESSAGE', multiple_consumers => false);
EXEC DBMS_AQADM.CREATE_QUEUE (queue_name => 'textmessage_queue', queue_table => 'queue_textmessage_table');
EXEC DBMS_AQADM.START_QUEUE (queue_name => 'textmessage_queue');The createJMSClient(); used by the enqueue and dequeue methods
    private JMSTopic createJMSClient() {
        JMSTopic aq = new JMSTopic();
        try {
            TopicConnectionFactory topicConnectionFactory = null;
            // Get topic connection factory
            Properties info = new Properties();
            info.put(userName, userPassword);
            topicConnectionFactory = AQjmsFactory.getTopicConnectionFactory(connectString, info);
            // Creates an AQ topic connection and session
            aq.connection = topicConnectionFactory.createTopicConnection(userName, userPassword);
            // If a session is transacted, message acknowledgment is handled automatically
            //   by commit and recovery is handled automatically by rollback
            aq.session = aq.connection.createTopicSession(true, // Session is transacted
                        Session.CLIENT_ACKNOWLEDGE); // Acknowledges by commit and rollback
            System.out.println("Successfully created AQ session");
        } catch (Exception ex) {
            System.err.println("AQApplication.createJMS(): " + ex.getMessage());
            System.err.println("user = " + userName + ", password = " + userPassword + ", destination = " +
                               connectString);
            ex.printStackTrace();
        return aq;
    }Java code to enqueue a text message
        JMSTopic client = myMessage.createJMSClient();
        AQjmsSession aqjmssession = (AQjmsSession) client.session;
        AQjmsDestination destination = (AQjmsDestination)aqjmssession.getQueue(myMessage.DB_AQ_ADMIN_NAME, "textmessage_queue");
        TextMessage createTextMessage = aqjmssession.createTextMessage("This is my first text message");
        MessageProducer producer = aqjmssession.createProducer(destination);
        producer.send(createTextMessage);
        aqjmssession.commit();Java code to dequeue a text message
        JMSTopic client = myMessage.createJMSClient();
        AQjmsSession aqjmssession = (AQjmsSession)client.session;
        AQjmsDestination destination =
            (AQjmsDestination)aqjmssession.getQueue(myMessage.DB_AQ_ADMIN_NAME, "textmessage_queue");
        MessageConsumer consumer = client.session.createConsumer(destination);
        System.out.println("Waiting for a message ...");
        Message message = consumer.receive();
        System.out.println("Message received !!");

You have to start the connection (aq.connection) to receive the message. This is not required for enqueue, but required for dequeue.

Similar Messages

  • Exception when trying to dequeue text message.

    I have WebLogic Server 10.3.5 and i used this tutorial http://download.oracle.com/docs/cd/E12839_01/web.1111/e13738/aq_jms.htm to connect AQ on Oracle Database 11g with WebLogic Server as a Foreign Server.
    I can enqueue text message from application written in java using javax.jms library.
    But everytime i try to dequeue text message i get this exception on WebLogic Server:
    <Error> <EJB> <BEA-010079> <An error occurred while attempting to receive a message from JMS for processing by a message-driven bean: oracle.jms.AQjmsException: JMS-120: Dequeue failed
    Nested exception: oracle.jms.AQjmsException: JMS-122: Internal error Corrupted message
    The exception is : oracle.jms.AQjmsException: JMS-120: Dequeue failed
         at oracle.jms.AQjmsError.throwEx(AQjmsError.java:315)
         at oracle.jms.AQjmsConsumer.jdbcDequeue(AQjmsConsumer.java:1626)
         at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:1035)
         at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:960)
         at oracle.jms.AQjmsConsumer.receiveFromAQ(AQjmsConsumer.java:938)
         at oracle.jms.AQjmsConsumer.receive(AQjmsConsumer.java:790)
         at weblogic.deployment.jms.WrappedMessageConsumer.receive(WrappedMessageConsumer.java:201)
         at weblogic.ejb.container.internal.NewJMSMessagePoller$1.run(NewJMSMessagePoller.java:264)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.ejb.container.internal.JMSConnectionPoller.doPrivilegedJMSAction(JMSConnectionPoller.java:2702)
         at weblogic.ejb.container.internal.NewJMSMessagePoller.processOneMessage(NewJMSMessagePoller.java:260)
         at weblogic.ejb.container.internal.NewJMSMessagePoller.run(NewJMSMessagePoller.java:120)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: oracle.jms.AQjmsException: JMS-122: Internal error Corrupted message
         at oracle.jms.AQjmsError.throwEx(AQjmsError.java:334)
         at oracle.jms.AQjmsUtil.getTextData(AQjmsUtil.java:750)
         at oracle.jms.AQjmsTextMessage.readTextMessageContainer(AQjmsTextMessage.java:308)
         at oracle.jms.AQjmsTextMessage.<init>(AQjmsTextMessage.java:148)
         at oracle.jms.AQjmsConsumer.jdbcDequeue(AQjmsConsumer.java:1389)
         ... 13 more
    Anyone can help me?

    Hi,
    the problem is on the AQ side.
    Here, it is recommended to use UNICODE Database charcterset AL32UTF8.
    Hope this helps!
    Michael

  • Text Message Options

    Some of my friends have 2 or 3 numbers.. My problem is, if they send me a text message, i dont know which number they used, is there any option to display contact number or message detail?
    im running 10.0.9.348

    It would be nice to know , hopefully future release would add that..

  • TS4097 we have multiple users in our family and multiple devices all sharing one itunes account.  i think we are all synced to one icloud account and it is a nightmare....contacts lost, text messags showing up on multiple devises etc.  how do we fix this?

    We have our family sharing one itunes account.  we have 3 iphones, 2 macbook airs, 2 ipads and 1 mac.  I am not sure how we even got started on the icloud but somehow we did and everything is a mess.  The ipads are showing the text messages, the contacts are all combined, the apps that my duaghter downloads are appearing on all devices.  how do we fix this so contacts are not shared, messages are not shared and apps are not automatically synced to all devises?

    You have two different issues going on.  You are getting each other's messages because you are sharing the Same Apple ID for iMessage.  This can be corrected by going to Settings>Messages>Send & Receive on add the devices and doing one of the following:
    Either uncheck the email address shown under "You can be reached by iMessage at" on all of your devices; or
    If you want to continue to receive iMessages at this email address on one of your devices, on all of the other ones tap the Apple ID at the top, sign out, then sign back in using a different Apple ID (so all devices will be using a different Apple ID for iMessage).  Note: you can continue to share an Apple ID for purchasing from the iTunes and App stores.  It does not need to be the same as the ID you are using for iMessage, FaceTime and other services.
    The second issue is that you are sharing the same iCloud account on your devices.  When you do this any data you sync with the shared iCloud account such as contacts is merged and will appear on all devices connected to the account.  To fix this you both need to have separate iCloud accounts (you can continue to share the same Apple ID for purchasing from the iTunes and app stores). 
    First decide which device(s) will be keeping the current iCloud account.  On the one(s) that will be changing accounts, if you have any photos in photo stream that in your camera roll or backed up somewhere else that you want to keep on the device(s), save these to the camera roll by opening the photo stream album in the thumbnail view, tapping Edit, then tap all the photos you want to save, tap Share and tap Save to Camera Roll. 
    Once this is done, go to Settings>iCloud, scroll to the bottom and tap Delete Account.  (This will only delete the account from this device, not from iCloud.  The device(s) that will be keeping the account will not be effected by this.)  When prompted about what to do with the iCloud data, be sure to select Keep On [iDevice].  Next, set up a new iCloud account using a separate Apple ID (if you don't have one, tap Get a Free Apple ID at the bottom).  Then turn iCloud data syncing for contacts, etc. back to On, and when prompted about merging with iCloud, choose Merge.  This will upload the data to the new account.  Repeat this process for all the devices that you need to migrate to new accounts.
    When finished, to un-merge the data in your accounts you will have to go to icloud.com on your computer and sign into each iCloud account separately and manually delete the data you don't want (such as deleting the other person's contacts from your account, and vice versa).

  • HT3529 My wife and I both have an iphone.   We initially created it under her apple id.   We will receive each others text messages from certain people not all.   Any ideas why and what we can do to stop it

    My wife and I both have an iphone.  We initially set them up under one apple id account.  When we text sometimes we will receive each others text messages from others.   Example I will text a friend...she will not see my text but the reply comes to both of us.  It seems to be random which ones.  Any ideas how to correct this

    Yup, get your own AppleID.
    The messages that are being sent to both phones are technically not text, they are Apple's iMessage. They use the data part, not the texting part. So if you have an iPad or a Mac computer, you can send/receive the iMessages there too.
    KOT

  • How can I stop the sharing on the iPhones that are in the same account because its sharing every thing even text messages

    How can I stop the sharing on the iPhones that are on my account because its sharing everything even text messages and its driving everybody crazy

    An icloud account is designed to be used by one user to keep his/her devices in sync. 
    If you have muitiple family members or friends using the same account as yours, then have them get their own Apple IDs and icloud accounts.
    If you mean you want to stop the sharing between all your devices, then on any one device, go to Settings>icloud and turn off the services you don't want that device to share/sync.  Or turn off icloud altogether if that's what you want.

  • HT5012 I am having difficulty XMIT/REC text messages to family members using Android phones?  I have a 3GB data plan and all switches and buttons are set properly.  Any suggestions?

    I am having difficulty XMIT/REC text messages to family members using Android phones?  I have a 3GB data plan and all switches and buttons are set properly.  Any suggestions?

        Hello APVzW, we absolutely want the best path to resolution. My apologies for multiple attempts of replacing the device. We'd like to verify the order information and see if we can locate the tracking number. Please send a direct message with the order number so we can dive deeper. Here's steps to send a direct message: http://vz.to/1b8XnPy We look forward to hearing from you soon.
    WiltonA_VZW
    VZW Support
    Follow us on twitter @VZWSupport

  • My family of four (2 iPhones, 2 iPods) all share the same iTunes account.  Many text messages sent to or from mine or my husband's phones are also received on my daughter's iPod, and vice versa. How do I fix this?

    How can I keep text messages sent from my or husband's phone from being received on daughter's iPod, and vice versa? We have five devices on one iTunes account - 2 iPhones, 2 iPods and an iPad.

    Hello Hrd1977,
    This is typically caused by both devices sharing an Apple ID for iMessage and FaceTime.  I would recommend signing out of iMessage on your daughter's device.  Go to Settings > Messages > Send & Receive, tap your Apple ID, and select Sign Out. Then sign in with the desired Apple ID.
    iOS: Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    Cheers,
    Allen

  • Text Messages & Calendar Time off by 1 Hour

    Hi. Does anyone else have this problem?  I can't seem to find it in the forum discussions when I search.  Please direct me if I missed it.
    My time zone is correct.  Here's the situation.  When I open the text message app all the messages are listed and the time in that location is correct.  When I open any one of the contacts to view the text message it is ahead by one hour.  To clarify..if you send me a text right now at 10:22.  In the list it will show 10:22 but when I open up our discussion your message says it arrived at 11:22 even tho it isn't even 11:22 yet.  All messages do this.
    Calendar
    The calendar acts similar.  If I enter an appointment in SCHEDULE mode (the little arrow at the top changes the view) then all appointments will be ahead an hour but when you go into the appointment to view it..it says the correct time but views wrong.  So viewing your day at a glance in this mode shows all appointments out by an hour.   Because of this I have had to use my calendar in AGENDA mode or view so the times show up correctly and don't drive me crazy. 
    Anyone??
    Thanks
    Solved!
    Go to Solution.

    Thank you for pointing me to the post.  Unfortunately the workaround doesn't  work.
    The only work around for this problem is to keep your calendar in Agenda mode for anyone else having same problem.  And we have to live with the text messages being an hour off until an update comes which might be never in this province...yes a slam to Sasktel..thanks

  • When I send a photo via a text message...

    When I send a picuture via a text message using my iPhone 5, the text message contains all the photos that I have sent/received from a particular person.  Is there a way to stop this so that I only send one picture at a time?  I do not think I should have to send a text message that contains multiple pictures every time I send a picture to that same person.

    Hello and thank you for using the Palm Help Forums!
    Well, there are several things that can cause the device to reset.
    One, corrupted data. If you have corrupted data on the device, when trying to access it, it can and most likely will, cause the device to reset.
    Two, Low memory. If the device has low memory, the device will operate slow and most likely reset because it doesn't have a lot of free space. The free space remaining on the device is it's thinking room you could say. The smaller the thinking margin, the more likely it will not perfrom correctly. Best way to fix memory issues is to get an SD card and save all media files to the SD card.
    Three, incompatible software. If there is incompatible 3rd party programs installed on the device this can cause several problems. Resets, missing data, and other functions not performing correctly.
    The best thing I can recommend you do is a hard reset. A hard reset will erase all data on the device but restore all settings to default. Be sure to backup your data on a PC before performing a hard reset. For further information and instructions on how to do a hard reset go to kb.palm.com and look up article number 42094 in the solution ID search field.
    I hope this helps and let me know if you have any further questions or issues.
    -Pat
    Post relates to: Treo 800w (Sprint)

  • I was recently searching in my iPhone 3GS for a phone number, and the search hits revealed text messages that I have long ago deleted and would rather not have in my iPhone. How do I delete these once and for all?

    It was the strangest thing. You would think that once you delete a message off your phone it is gone.
    But in the "search iPhone" feature several key numbers like an area code reveal phone numbers of people
    who aren't in my contact list, specifically the first few words of text messages that I deleted long ago.
    I would like to eliminate these once and for all.
    Will "Erase Content and settings" do this for good? Once I restore the phone will they come back?
    Thanks.
    ******note found another thread relating to this********no need to reply********
    Message was edited by: stewart g.

    The terms of service of the Apple Support Communities prevent us from helping anyone with a jailbroken phone.
    You're on your own.  Good luck.

  • How to I get my iPad to not receive text messages and apps from my iPhone?

    After doing the new software update on my phone, computer, and Ipad my Ipad has been linked directly to my phone. I have changed all setting so that it wont share of communicate but in the update process all saved data was removed from my IPAD I went back to Itunes and after the update to that all the backed up information was gone and the cloud didnt have any backed up information in it from the issues they had with the cloud in August. How do I get my Ipad to disconnect from my phone that it wont recieve text messages or anything else associated with my phone?

    You are probably going to have to sign out of/turn off Messages on the phone and the iPad and then start all over again and enable messages on the phone first so that the number is accessible again to use on the iPad in Settings>Messages>Send and Receive at>You can be reached by iMessages at. You need to be able to select your phone number in there.
    This kb article explains it in detail.
    http://support.apple.com/kb/HT5538

  • My iphone 4s can't send text messages or receive calls

    I've had my phone a few months now and I have had no issues.  All of a suddent this morning I notice I can not receive calls or send out text messages.  I'm told they either go straight to my voicemail or they get a message saying my service has been temporairly disconnected.  I can make calls and I can receive texts. I can access the internet through my data.  Has anyone had this issue?  If so does anyone know of a fix?  My carrier says the towers in my area are fine with no known issues.

    You are not alone I could not only send messages but I could not even type in the box went in the setting and notice that iMessage was turned off and when I reactivated it my phone now making the most horrible sound when a message comes in or goes out and I cannot stop it. Also make sure that the Do Not Disturb option is on.

  • I can call out but all incoming calls are going directly to VM with no signal that I missed a call or have VM. I can send/receive text messages from other iPhone/iPad/iTouch users, I am assuming this is really "iMessage." Is it apple software?

    I have spent hours on the phone with Apple and AT&T. I went thought reset, on/off, etc, etc with both companies to no avail. Each company pointed fingers at the other....as being the source of the problem.
    Problems: Suddenly ALL  incoming calls were going directly to VM with no signal I missed calls and/or had VM. I was also unable to receive all Text Messages...Oddly, I could send text messages to anyone (even non-apple users but I could not receive their responses)........then I when I got home I started receiving text messages from other apples users ONLY. I assume now - iMessage kicked in and I could text (send/receive)  other iPhone/iPad/iTouch users ONLY. ....yes, I could still (send) text messages to my husband's blackberry (he received my messages fine) but my phone would NOT receive his text respones.
    Finally, I googled the problem and found this community where other people have had the exact same problems! One person said he "turned off 3 G" which was the solution for him....so I did the same and VIOLA! My problem  solved! Nevermind the fact that I pay for 3G and cannot use it....so here's my question, if 3G is the problem on my phone is this an APPLE issue or a NETWORK problem? Do I purchase a new phone and slip in my same SIM card and hope the same does not occur or do I get a whole new SIM card and phone? What is the long term resolution to this problem?
    I am happy however to find that my problem is NOT an isolated incident and wish Apple or AT&T had told me this is not so uncommon because I thought (based on the baffled response from Apple) that this has never occurred before.  Where is Steve Jobs when we need him?

        jsavage9621,
    It pains me to hear about your experience with the Home Phone Connect.  This device usually works seamlessly and is a great alternative to a landline phone.  It sounds like we've done our fair share of work on your account here.  I'm going to go ahead and send you a Private Message so that we can access your account and review any open tickets for you.  I look forward to speaking with you.
    TrevorC_VZW
    Follow us on Twitter @VZWSupport

  • I switched from an iPhone to a Galaxy s4.  Everything seems ok except text messaging with people who have an iPhone.  I can send them a text, they can see it, but I cannot see what they text back.  What can I do please?

    I just switched from an iPhone to a Galaxy 4S and I like it except for text messaging.  I can text, they can see it, but I cannot see their response if they are using an iPhone.  Can you help me with this?  What do I do please?

        Congratulations on your new phone kathdogg! Now let's get your messaging working correctly. If you still have your old device, turn it on, go to settings, and turn off iMessaging.
    If you are no longer in possession of your old device, you will need to remove your phone number from your Apple Support Profile. This can be done here: http://bit.ly/1cst2SC 
    Please keep us posted, and let us know if this resolves your issue!
    Thank you,
    MichelleH_VZW
    Follow us on Twitter @VZWSupport

Maybe you are looking for