How to retrive all unread messages from a topic?

Hello!
          I have a webapp that stores TextMessages in a Topic in WebLogic.
          I have an ejbapp (Message driven bean) that reads messages from the topic.
          If both are up and running the ejbapp reads all messages sent from the webapp to the topic.
          But if I stop the ejbapp for a while and sends a couple of messages to the topic and then deploy the ejbapp again, then the ejbapp does not read the unconsumed messages. If I send a new message to the topic the ejbapp reads that new messages but it does not get the previous messages that are on the topic.
          Is this the way it should work? Or could I get the message driven bean to consume all the messages that it has not consumed from the topic when it starts?
          My weblogic-ejb-jar.xml looks like:
          <pre><!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN' 'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'>
          <weblogic-ejb-jar>
          <weblogic-enterprise-bean>
          <ejb-name>OrderManagerMDB</ejb-name>
          <message-driven-descriptor>
          <pool>
          <max-beans-in-free-pool>200</max-beans-in-free-pool>
          <initial-beans-in-free-pool>20</initial-beans-in-free-pool>
          </pool>
          <destination-jndi-name>jms/OrdersTopic</destination-jndi-name>
          <connection-factory-jndi-name>jms/OrdersConnectionFactory</connection-factory-jndi-name>
          </message-driven-descriptor>
          <enable-call-by-reference>True</enable-call-by-reference>
          </weblogic-enterprise-bean>
          </weblogic-ejb-jar></pre>
          And my ejb-jar.xml looks like:
          <pre><!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
          <ejb-jar>
          <enterprise-beans>
          <message-driven>
          <ejb-name>OrderManagerMDB</ejb-name>
          <ejb-class>brownbagwarehouse.OrderManagerMDB</ejb-class>
          <transaction-type>Container</transaction-type>
          <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
          <message-driven-destination>
          <destination-type>javax.jms.Topic</destination-type>
          </message-driven-destination>
          </message-driven>
          </enterprise-beans>
          </ejb-jar></pre>
          My MDB onMessage looks like:
          <pre>public void onMessage(Message message)
               try
                    TextMessage textMessage = (TextMessage)message;
                    System.out.println(textMessage.getText());
               catch(Exception e)
                    e.printStackTrace();
          </pre>
          Best regards
          Fredrik

For subscriptions to continue to exist even while no subscriber is attached they need to be "durable". See the EJB programmer's guide, and search for "durable" in the MDB doc.
          In JMS terminology these are termed "durable subscriptions".
          Tom

Similar Messages

  • How to retreive all unconsumed messages from a topic with a MDB?

    Hello!
    I have a webapp that stores TextMessages in a Topic in WebLogic.
    I have an ejbapp (Message driven bean) that reads messages from the topic.
    If both are up and running the ejbapp reads all messages sent from the webapp to the topic.
    But if I stop the ejbapp for a while and sends a couple of messages to the topic and then deploy the ejbapp again, then the ejbapp does not read the unconsumed messages. If I send a new message to the topic the ejbapp reads that new messages but it does not get the previous messages that are on the topic.
    Is this the way it should work? Or could I get the message driven bean to consume all the messages that it has not consumed from the topic when it starts?
    My weblogic-ejb-jar.xml looks like:
    <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN' 'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>OrderManagerMDB</ejb-name>
    <message-driven-descriptor>
    <pool>
    <max-beans-in-free-pool>200</max-beans-in-free-pool>
    <initial-beans-in-free-pool>20</initial-beans-in-free-pool>
    </pool>
    <destination-jndi-name>jms/OrdersTopic</destination-jndi-name>
    <connection-factory-jndi-name>jms/OrdersConnectionFactory</connection-factory-jndi-name>
    </message-driven-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>And my ejb-jar.xml looks like:
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
    <enterprise-beans>
    <message-driven>
    <ejb-name>OrderManagerMDB</ejb-name>
    <ejb-class>brownbagwarehouse.OrderManagerMDB</ejb-class>
    <transaction-type>Container</transaction-type>
    <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
    <message-driven-destination>
    <destination-type>javax.jms.Topic</destination-type>
    </message-driven-destination>
    </message-driven>
    </enterprise-beans>
    </ejb-jar>My MDB onMessage looks like:
    public void onMessage(Message message)
    try
    TextMessage textMessage = (TextMessage)message;
    System.out.println(textMessage.getText());
    catch(Exception e)
    e.printStackTrace();
    }Best regards
    Fredrik

    I am not much familiar with Weblogic, but i would suggest, you do a search for how to setup "Durable Subscriptions" in Weblogic. This will ensure the the messages that were sent when the consumer was not available, will be delivered once the consumer is available

  • How can i recieve unread message from pop3 server

    hi ! i'm using pop3 server
    I used the following code to set read message.
    String host="servername";
    String username="xx.domainname";
    String password="xxxxxx";
    try
    Session mySession=Session.getDefaultInstance(System.getProperties(),null);
                   mySession.setDebug(true);
              //get a specific mail storage
          myStore=mySession.getStore("pop3");
    // Store myStore=(Store)session.getAttribute("myStore");
    myStore.connect(host,username,password);
    myFolder= myStore.getFolder("INBOX");
    if (myFolder == null)
                        System.err.println("No inbox folder is available");
                   else
                        System.out.println("Accessing"+ myFolder.getFullName()+"folder========" );
                   myFolder.open(Folder.READ_WRITE);
    Message[] message=myFolder.getMessages();
      message.setFlag(Flags.Flag.SEEN,true);
    System.out.println("Flags ========: "+message[i].getFlags());
    myFolder.close(true);
    myStore.close();
    catch(Exception e)
    Again if i receive  message from server it is not showing unread messages. it will return as 0.(I used the  method *getUnreadMessageCount()*)
    Can i have some help
    Thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    The POP3 protocol supports no flags.
    See the FAQ and the javadocs for the com.sun.mail.pop3 package.

  • I accidenttly deleted my notes and the icloud cleared all the message from both ipad and iphone  ...How can i get it back?? If I can ??

    I accidenttly deleted my notes and the icloud cleared all the message from both ipad and iphone  ...How can i get it back?? If I can ??

    Your notes should be stored in your backup, so if you have backed up the iPad and that backup does contain those notes that you deleted, you can try restoring from your backup. If you haven't backed up the iPad since you created those notes, they are gone.
    If you backup with iCloud only, restoring from backup involves erasing the device and then going through the setup all over again and finally restoring from the iCloud backup. This article explains the process quite clearly.
    http://gigaom.com/apple/ios-101-set-up-and-restore-from-icloud-backup/
    If you backup with iTunes, connect the iPad to your computer, launch iTunes and right click on the device name on the left and select - Restore from Backup. But before you do that .... turn off auto sync in iTunes - without connecting the iPad - launch iTunes and go to Edit>Preferences>Devices and check the box at the bottom of that window in order to turn off auto sync.
    Email messages are not stored in your backups.

  • In my email all the messages from one person bunch together and I would like to separate them. I have done this before on my iPhone but just recently got an iPad and its doing it on this, so does anyone have any ideas how to fix this issue?

    In my email all the messages from one person bunch together and I would like to separate them. I have done this before on my iPhone but just recently got an iPad and its doing it on this, so does anyone have any ideas how to fix this issue?

    Settings >> Mail, Contacts. Calendars >> Organise by Thread. Switch to OFF to see every individual email in the Inbox.

  • How do I stop all the messages from Apple Support Community

    How do I stop all the messages from Apple Support Community

    Go up to: Your Stuff > select Preferences > select Email Notification Preferences > change the bubbles to No's and hit the Save button.

  • How do I sun all my messaging from phone, iPad mini, and macbook pro?

    How do I sun all my messaging from phone, iPad mini and MacBook Pro? I want to be able to see all my messages from any device? Thank you for the help in advance.

    Read this kb article for detailed instructions on how you can do this. I sync all of my messages from my iPhone, iPod Touch, iPad, and MacBook Pro.
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage

  • How to get all the values from the dropdown menu

    How to get all the values from the dropdown menu
    I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
    How do I get number of item is selection dropdown?
    How do I extract a ?name? for each value, one by one?
    How do I change a selection by referring to particular index of the item in a dropdown menu?
    Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
    RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
    Message was edited by: testtest

    The findElement method allows various attributes to be used to search. Take the following two examples for the element below:
    <Select Name=ProdType ID=testProd>
    </Select>
    I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
    Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
    If I want to search by id I could do the following:
    Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
    Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
    You can use the FindElement to grab links, text boxes, etc.
    The next example grabs from a link on a page
    Home
    Set x = RSWApp.om.FindElement("Home","A","innerText")
    I hope this helps clear it up.

  • How can I send a message from database to a J2EE application?

    How can I send a message from database to a J2EE application?
    If I have a codetable in database that has new or modified values I have to refresh the codetable in my J2EE application.
    Most effective way would be send a message to initiate a table reload from J2EE app, but I don't know how to do this.
    Now I have a background thread that regular reads the table and looks for changes.

    http://www.oracle.com/technology/products/integration/bam/10.1.3/TechNotes/TechNote_BAM_AQ_Configuration.pdf
    This document details how to create triggers on a table that send out JMS messages.
    In this example, the messages are going to Oracle BAM.. your message could go to your J2EE application listening to its own topic/queue.
    an alternative idea.
    you could also just cache your lookup table with something like Oracle Coherence and than try to ensure that all changes to the lookup go through Coherence, so that you won't need to do notification from the db up to the application. the application and the lookup data management tool would be using the data grid for management of the lookup table data, and the data grid (coherence) would persist the lookup data changes back to the db.

  • How can I delete text messages from my iphone?

    Hello everyone,
    How can I delete text messages from my iphone?  I do not want to reset my iphone setting. If it is nesscary to reset my iphone setting, will I lose everything?
    Please let me know,
    Thanks,

    Just delete them. Or, do you mean beyond just deleting them? Then, you'd need to wipe the phone - select Settings > General > Reset > Erase All Content and Settings. That's a secure wipe of the iPhone contents, takes several hours (connect to AC power). You'll need to set your phone up from scratch (and erase the old backup(s) from your computer, since your SMS history is part of the backup).

  • How do I clear unread message in Apple Mail?

    Using Apple Mail 6.6 on a MacBook Pro running OX X 10.8.5.  Our Exchange server is 2007/2010. Besides my Exchange mail, I have 2 Gmail accounts and one iCloud account in Apple Mail.  I have no issues with the Gmail or iCloud accounts.
    Currently, I have 34 "unread" message from my Exchange account in Apple Mail.  On my iPhone, iPad and Outlook (PC), I have 0 unread messages.  When I filter Apple Mail for unread messages, there are none.  It's as if these are phantom unread messages.  I did a rebuild of the Exchange account in Apple Mail and I deleted and re-installed the Exhange Account in Apple Mail.  And still I am left with these mysterious 34 unread messages.
    It is really annoying.  Any thoughts?

    Quit Mail. Force quit if necessary.
    Back up all data. That means you know you can restore the Mail database, no matter what happens.
    Triple-click anywhere in the line below on this page to select it:
    ~/Library/Mail/V2/MailData
    Copy the selected text to the Clipboard by pressing the key combination command-C. In the Finder, select
    Go ▹ Go to Folder
    from the menu bar. Paste into the box that opens (command-V), then press return.
    A folder window will open. Inside it there should be files with names as follows:
    Envelope Index
    ExternalUpdates.storedata
    Move those files to the Desktop, leaving the window open. Other files in the folder may have longer names that begin as above. Move those files, if any, to the Trash.
    Log out and log back in. Relaunch Mail. It should prompt you to re-import your messages. You may get a warning that the index is damaged and that Mail has to quit. Click OK. Warning: The process may take hours if you have gigantic mailboxes. For reasonable-sized mailboxes, it should only take a few minutes.
    Test. If Mail now works as expected, you can delete the files you moved to the Desktop. Otherwise, post your results.

  • How can I select unread messages only?

    Sometimes a spam message makes it through the filter and because it is timestamped incorrectly it disappears in the depth of my huge inbox. It is very inconvenient to look through all messages just to find that one ... in Entourage I could select all unread messages and thus it was very easy to find those annoying spam mails. I haven't found a similar command, how can I do this in Mail?

    Hi,
    Easily done -- make sure in the menu pulldown beneath View/Columns to have selected the one for Flags -- then sort on that column. Also, if you keep the column for message Number, that is assigned in the order in which you received the message regardless of its date, and can sorted on.
    Ernie

  • How to remove copy of message from .Mac server

    To autoremove the copy of a message on the .Mac server, Mail help says "choose Mail > Preferences and click Accounts. Select a .Mac or IMAP account, click Mailbox Behaviors, and change the option for storing messages on the server."
    Unfortunately, that option seems to be missing from both the "Mailbox Behaviors" and "Advanced" tabs.
    I have a separate pop account from another ISP that does have the option under the "Advanced" tab.
    Does anyone know how to do this for the .Mac account?
    Thanks!
    Jim
    iMac 24"   Mac OS X (10.4.9)   Mail version 2.1.1

    A .Mac type account with Mail is really an IMAP account and behaves in the same way.
    There is no option to automatically remove messages from the server for an IMAP account's Inbox mailbox with any email client such as the Mail.app.
    You can access a .Mac account as the following account types with the Mail.app.
    .Mac
    IMAP
    POP
    And as the following account types with another email client on your Mac or on another computer - a Mac or Windows PC.
    IMAP
    POP
    I access my .Mac account as a .Mac type with Mail and as an IMAP account with Outlook Express on my Windows XP notebook at work.
    A benefit of an IMAP account is the ability to keep all server stored mailboxes available and synchronized with an email client on different computers.
    If you want to access your .Mac account as a POP account with Mail will require deleting and recreating the account selecting POP as the account type instead of .Mac or IMAP.
    If you are not storing the account's Sent messages on the server with Mail, before deleting the account you need to transfer all sent messages from the account's Sent mailbox to a user created "On My Mac" location mailbox which is stored locally on the hard drive.
    When deleting an account with Mail, the account named folder at Home > Library > Mail which stores the mailboxes for the account is also deleted along with the mailboxes for the account.
    This will not affect any messages currently stored on the server in the account's Inbox mailbox.

  • Mail downloading all 800000 messages from Yahoo

    So I installed Mountain Lion and set up my Yahoo! Mail account so that I could receive incoming messages in notifications center and sync my notes to my iPhone. Now Mail says it is downloading all 800000 messages from my mailbox. I've had this account for like 10 years and I like to keep all of my messages. Is there really no way to limit how many messages Mail downloads? The iPhone does this fine. Since the account is IMAP too, if I delete messages in mail it deletes them from the server. I guess I'll have to make an archives folder and move stuff from my inbox there and not sync it.
    Also, my notes are not syncing with my iPhone...My iPhone is set to sync to yahoo notes, but when I clicked notes for iCloud it made me set up a @me account. Do I need to update to iOS 5.1 for notes sync to work with my iPhone?

    RGH!
    So, I followed the advice on the other link (deleting the downloaded messages info file), and even deleted my whole sent messages.imapmbox and rebuilt it, but my computer keeps downloading all 7500 or so sent messages over and over (more or less every time I start up Mail after the computer has been shut down). The sent messages box keeps growing and growing until I rebuild. On my MBP the folder is 5GB or so, and currently the one on my (problem) MacPro is 14gb and will surely be bigger before the weekend is out.
    Another thing: If I try to stop the messages from downloading (by clicking on the little 'x' next to the progress bar in the 'Mail Activity' window, then it just ADDS the 7500 messages again onto the total to be downloaded (meaning 15,000 messages downloading and the 22,500 if I try to cancel again)
    This is highly frustrating, and potentially damaging to my system drive if I fail to keep tabs on the folder.
    Please, any other ideas/suggestions?

  • How do I send text messages from my Ipod touch?  The "send" button does not light up after typing in the message.

    How do I send text messages from my Ipod touch?  The "send" button does not light up.

    First of all, you need you have at least iOS 5 installed. Second, the person you are texting must have an iDevice with iOS 5 or higher installed. You can´t send messages to an non-iDevice. You´ll also need an Wi-Fi network to send iMessages. Hope it helped!
    Message was edited by: AppleTechTalk1100

Maybe you are looking for