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

Similar Messages

  • 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

  • How to select all the colomns_names from a table, with their datatypes ..

    hi :)
    i would like to know, how to select in SQL all the columns names from a table with their datatypes so that i get something like this :
    Table 1 : table_name
    the column ID has the Datatype NUMBER
    the column name has the Datatype Varchar2
    Table 2 : table_name
    the column check has the Datatype NUMBER
    the column air has the Datatype Varchar2
    and that has to be for all the tables that i own ! ..
    P. S : i m trying to do this with java, so it s would be enough if you just tell me how to select all the tables_names with all their colums_names and with all their datatypes ! ..
    thank you :)
    i ve heard it can be done with USER_TABLES .. but i have no idea how :( ..
    Edited by: user8865125 on 17.05.2011 12:22

    Hi,
    The data dictionary view USER_TAB_COLUMNS has one row for every column in every table in your schema. The columns TABLE_NAME, COLUMN_NAME and DATA_TYPE have all the information you need.
    Another data dictionary view, USER_TABLES, may be useful, too. It has one row pre table.

  • How to display all items titles from custom list with checkbox to select for each user

    Hi All,
    I have a requirement in a sharepoint 2013 development project.
    A custom list items will be created by admin with the following columns:
    Title
    Hyperlink
    User business unit (This column which is a metadata will be a userprofile property)
    In a page/form I have to display the list of titles with a check box based on each user business unit and each user will be allowed to check the list of titles and hit save. And then have to display the list chosen by the user in a webpart.
    If they want to modify their list they have to go to the page/form again and will uncheck the list.
    Am not sure whether I can achieve this through sharepoint out of box feature, I have not done any custom development.
    Please provide your valuable suggestions/ideas on this. Thanks for looking on this !!!

    Hi,                                                             
    Per my knowledge, there are no such OOTB features can meet your requirement, however, there is a workaround that if you can modify your requirement a bit.
    Based on your description, you want different users be able to select values from a list and generate a list own by them.
    If this is what you mean, we can do it like this:
    1. Create another list "Users" which stores the names of every users;
    2. Create a list "Result" which will be available for every user to add their own items, this list will have four Lookup columns and they look up to the "Users" list and the
    list you mentioned before;
    3. Users can add items into "Result" list by selecting the needed values from the other two list, then the items he/she created will be connected to them with the help of the
    Lookup column which looks up to the "Users" list.
    4. You can take use of the OOTB permission management of list to control the access of each item in the "Result" list, and it will be easier for you to manage and filter the
    information you needed.
    The links below about Lookup column for your reference:
    http://office.microsoft.com/en-us/sharepoint-server-help/create-list-relationships-by-using-unique-and-lookup-columns-HA101729901.aspx
    http://www.dummies.com/how-to/content/lookup-columns-in-sharepoint-2010.html
    Best regards
    Patrick Liang
    TechNet Community Support

  • 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 sync my contacts from my iPhone with my macbook pro for messaging purposes?

    How do i sync my contacts from my iPhone with my macbook pro for messaging purposes?

    Hey dthompson2108, 
    Thanks for participating in the Apple Support Communities. 
    You can sync contacts between your iPhone and MacBook Pro using iCloud or iTunes.
    See this link for help with setting up iCloud on your computer and device(s):
    Apple - iCloud - Learn how to set up iCloud on all your devices.
    Instead of turning on iCloud on your iPhone and Mac, you can sync using iTunes as explained in this article: 
    Sync your iPhone, iPad, and iPod with iTunes using USB - Apple Support
    All the best,
    Jeremy 

  • 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