Active mq - reading few times the same message

Hi, i've got a question (problem?) about active mg. Firstly, i must admit that i'm a newbie to JMS.
ok, so i wrote 2 threads - one for reading messages, second for sending them. The thread for sending, sends only one (test) message and it finishes. the problem is, that the thread for reading (which connects, reads, sleeps for 15sec, connects, reads, sleeps for 15sec and so on)- reads the message few times.. I do not know what is the rule-should i read something (what?) to check if this message was already read by me? Or maybe i do not properly understand how it should works, or maybe i've got a problem in my code?:
public void run() {
      while (state) {
         receiveMessages();
         try {
            Thread.sleep(sleepTime);
         } catch (InterruptedException inex) {
            inex.printStackTrace();
   public void onMessage(Message message) {
      if (message instanceof TextMessage) {
         TextMessage textMessage = (TextMessage) message;
         System.out.println("Received message:\n" + textMessage);
   public synchronized void onException(JMSException jmsex) {
      System.out.println("JMSException");
      System.err.println(jmsex);
   protected void receiveMessages() {
      System.out.println("Connecting to URL " + url);
      ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
      try {
         connection = connectionFactory.createConnection();
         connection.setExceptionListener(this);
         connection.start();
         /* create the session */
         session = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
         destination = session.createQueue(subject);
         replyProducer = session.createProducer(destination);
         replyProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
         consumer = session.createConsumer(destination);
         consumer.setMessageListener(this);
         if(transacted){
            session.commit();
      }catch(RejectedExecutionException rejex){
         System.out.println(rejex);
      catch (JMSException jmsex) {
         System.out.println(jmsex);
      } catch (UnsupportedOperationException unex) {
         unex.printStackTrace();
      } finally {
         if (consumer != null) {
            try {
               consumer.close();
            } catch (JMSException jmsex) {
               jmsex.printStackTrace();
         if (session != null) {
            try {
               session.close();
            } catch (JMSException jmsex) {
               System.err.println(jmsex);
               jmsex.printStackTrace();
         if (connection != null) {
            try {
               connection.close();
            } catch (JMSException jmsex) {
               System.err.println(jmsex);
               jmsex.printStackTrace();
      }for example, the result of executing this thread (remember that there was only 1 message sent):
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616
Received message:
ActiveMQTextMessage {commandId = 6, responseRequired = false, messageId = ID:ppm-55786-1276257991972-0:0:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:ppm-55786-1276257991972-0:0:1:1, destination = queue://ABC0, transactionId = TX:ID:ppm-55786-1276257991972-0:0:1, expiration = 0, timestamp = 1276257992758, arrival = 0, brokerInTime = 1276257992760, brokerOutTime = 1276258333378, correlationId = null, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties = null, dataStructure = null, redeliveryCounter = 16, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, text = First ActiveMQ message}
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616
Received message:
ActiveMQTextMessage {commandId = 6, responseRequired = false, messageId = ID:ppm-55786-1276257991972-0:0:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:ppm-55786-1276257991972-0:0:1:1, destination = queue://ABC0, transactionId = TX:ID:ppm-55786-1276257991972-0:0:1, expiration = 0, timestamp = 1276257992758, arrival = 0, brokerInTime = 1276257992760, brokerOutTime = 1276258353773, correlationId = null, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties = null, dataStructure = null, redeliveryCounter = 18, size = 0, properties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, text = First ActiveMQ message}
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616
Connecting to URL failover://tcp://localhost:61616
- Successfully connected to tcp://localhost:61616i do not understand why it has read the message in a nineth try! the message was already there-before i run this thread. why it took so long?
So it read the message, went sleeping, checked, went sleeping - and againg it read the message! why is that?
Can someone explain it to me? and suggest how should i do to read certain message only once?
thx and regards,
misty

Hi ..
Make sure your OS X software is up to date.
Click the Apple  top left in your screen.
From the drop down menu click Software Update
And try the troubleshooting steps for the built in iSight camera here >  How to Troubleshoot iSight

Similar Messages

  • After 10 attempts I still cant get flash player to install, I've uninstalled it each time,but still get the same message, that i need ot exit programms that are not running. explorer is ok.

    Hi there after firefox updated flash player stopped working so I was asked to update that too, I have tried both the direct x and plugin types and have installed and uninstalled it 10 times the same message comes up, halfway through the install process, that I must exit programmes that are using flash player, which since I have supposedly uninstalled it seems nonsensical, internet explorer seems unaffected, except when I uninstall flash player. I have followed all the instructions that appear on screen

    You have Shockwave Flash 10.2 r152 installed in the browser that you used to post here. Best to uninstall that version before installing a later version.
    As far as that message, Firefox needs to be closed before starting to install the Plugin version of Flash, so that Adobe can install the plugin for Firefox.

  • I have Photoshop CS5 Extended and it says updates available but when i download the updates it says updates failed please try again later, i have tried a few times and get the same message any help would be great i am running 64bit on windows 8

    I have Photoshop CS5 Extended and it says updates available but when i download the updates it says updates failed please try again later, i have tried a few times and get the same message any help would be great i am running 64bit on windows 8.

    I am running Windows 7 64 bit ultimate and have the same problem.  My hard drive crashed, installed a new one and then reinstalled CS5 extended.  Installation went fine, but can no longer open my camera RAW files from Photoshop (camera is a Canon EOS T2i.  The message also tells me I am not eligible for the update.  I am... and I cannot open my files and I could before.  I can find nowhere to contact Adobe to tell me how to proceed.  My daughter is all a registered user of the same product and she had no problems upgrading... we purchased ours each at the same time. I do know the difference is that I had to reinstall and she did not.  If that means anything.

  • When my lightroom opens up I keep getting an error message that states, "Lightroom encountered an error whne reading from its preview  cache and needs to quit" I have relaunched it a number of times and keep getting the same message.

    when my lightroom opens up I keep getting an error message that states, "Lightroom encountered an error whne reading from its preview  cache and needs to quit" I have relaunched it a number of times and keep getting the same message. Any thoughts on how to fix this?

    You need to delete your preview cache and have Lightroom rebuild it.   Cache location can be found here.
    https://helpx.adobe.com/lightroom/kb/preference-file-locations-lightroom-41.html
    Why And How To Clear Your Lightroom Cache - Lightroom Fanatic

  • Lightroom encountered an error when reading from its preview cache and needs to quit.  Says Lightromm will attempt to fix the problem the next time it launches, but on every re-launch I get the same message.  Any clue as to how to fix this problem?

    I recently updated my HP laptop's OS from WIndows8 to WIndows8.1.  When I went attempted to open Lightroom5 I got the following message:
    "Lightroom encountered an error when reading from its preview cache and needs to quit. "
    "Lightroom will attempt to fix the problem the next time it launches"
    Every time I relaunch I  get the same message.  I'd like to understand what might be causing the problem so I can remedy and get back to my photo editing. Any clue as to how to fix this problem would be greatly appreciated.
    JPM

    reset your preferences, Resetting (or 'Trashing') the Lightroom Preferences file - Lightroom Forums

  • When opening iTunes I continue to get the same messages, 'The program can't start because AVFoundationCF.dll is missing' and 'iTunes was not installed correctly. Error 7 (Windows error 126)' I've uninstalled, reinstalled many times - nothing! help please.

    When opening iTunes on my new Windows 7 PC I continue to get the same messages, 'The program can't start because AVFoundationCF.dll is missing' and 'iTunes was not installed correctly. Error 7 (Windows error 126)' I've uninstalled and reinstalled many times to no avail, even tried it on a different user account and still nothing. I recently installed Panda Internet Security 2012 (about 12 days ago), initially iTunes worked fine as usual but within the last few days I've been  unable to open it with the same messages appearing. I've read through some of these pages and tried everything that's been advised, uninstalling and reinstalling while internet and laptop security is swithched off, downloading tools to completely remove anything related to iTunes, tried it in Safe Mode, nothing has worked. I've also noticed that in the start menu when I click on iTunes, it says '(empty)' where it should have the logo and ability to start the program, does this mean it doesn't download + install properly each time I've tried? Any help would be enormously appreciated.

    Doublechecking. Have you also tried the following user tip?
    Troubleshooting issues with iTunes for Windows updates

  • Firefox will no longer play videos and keeps telling me to download the latest version of Adobe Flashplayer which I have done 5 times but still get the same message when I try to play videos. I can play videos on Internet Explorer and Google Chrome .

    Recently when I try to play a video on Firefox I get the same message that I need to download the latest version of Adobe Flash Player. At least 5 times I have downloaded Adobe Flash Player 11 Active X and Adobe Flash Player Plugin 64 bit. Problem is that even though I have the latest version I still get the same message when I try to watch videos on Firefox. The frustrating thing is I can watch videos on Internet Explorer and Google Chrome as well as on Safari. How does that make sense?
    Today, I upgraded to Firefox 10.0.2 (x86eng-us) hoping that would enable me to watch video on Firefox but it made no difference either. I would rather use Firefox as my default browser but if I can't get help so I can view video on it I will be forced to use another browser.

    Hi arpriltime,
    Have you looked at our [https://support.mozilla.org/en-US/kb/firefox-crashes-or-flash-plugin-crashes Flash plugin troubleshooting section]? There is a lot of useful information in there that should help you get to the bottom of your issue.
    Hopefully this helps!

  • I cannot download Mavericks. Every time the file download stops a message appears that says the file is damaged and cannot be used to install Mavericks. I delete the file, download again and the same message appears. What can I do?

    I cannot download Mavericks. Every time the file download stops a message appears that says the file is damaged and cannot be used to install Mavericks. I delete the file, download again and the same message appears. What can I do?

    I only have one video project that I ever published to iDisk. It didn't have any music or photo files attatched to it, just a few clips stitched together. I can play these clips right now in the Event Library (so I know the source files are on my computer), but strangely, under the Project Library, the project is not there. I'm almost certain that I didn't store the project on iDisk; I just completed the video and published it to iDisk (as a .mov file I think) for family to see. I've tried to figure out how to get iDisk to stop looking for this project to no avail.
    I don't know if others have experienced this, but if I click on any project and on the menu bar select Share --> Remove From --> Media Browser... it lists iPod, iPhone, iPad, tv, Computer and MobileMe. Why would MobileMe be an option here? This is the case for any video project I select. Didn't iLife '11 and/or OSX 10.8 remove all mention of MobileMe? I wonder if this is part of the problem too.
    Edit: I just removed every project I have from the Media Browser. Still no luck.

  • I can't open firefox. The home page doesn't come up, I just keep getting the Crash Reporter asking to restart/quit but every time I do this the same message comes back.

    I can't open Firefox. The home page doesn't come up, I just keep getting the Crash Reporter asking me to restart/quit but every time I do this the same message comes back. I've not been able to use Firefox for days now.

    Since a few days we have a lot of crashes with [http://www.trusteer.com/product/trusteer-rapport Trusteer Rapport]. If you have this program, try to disable it and see if that stops the crashing.<br>
    You can stop Rapport using Start Menu > Programs > Trusteer Rapport > Stop Rapport<br>
    You can ask their helpdesk when an updated version of their product will be made available or, if you don't need this software, uninstall it.<br>
    http://www.trusteer.com/support/en/report-problem<br>
    If you do not have Rapport, then we need to have a crash report ID. When you send Mozilla a crash report it just puts it in a giant database. We have no way of looking it up without the Report ID. I have no idea what is wrong without looking up the crash report. Please get the Report ID of your latest crash report.<br>
    See https://support.mozilla.com/en-US/kb/Firefox%20crashes<br>
    or http://kb.mozillazine.org/Firefox_crashes<br>

  • HT1420 I get en error message 42408. I have tried several times to activate my account but the same message keeps reappearing. Please help. I cant even sink my iPad or iPhone. Thanks

    I get en error message 42408. I have tried several times to activate my account but the same message keeps reappearing. Please help. I cant even sink my iPad or iPhone. Thanks

    After searching, found a few answers and tried one last thing-- allowing Safari to accept Cookies. I never use Safari so never changed any settings in it ever. However, I guess an update along the way turned off cookies in it and that was the blockage. Once I allowed Safari to use cookies I was able to redeem the gift card. SO, glad this board is here for these types of questions!!!!

  • Can 2 people in different locations at the same time import, access, send, and receive the same messages from the same email account

    I import messages into Thunderbird. I send and receive emails. One of the things I like about Thunderbird is that I can insert (image, link, etc) right where I want to, and I can Attach. But not just a simple attach file. No, I can also click Attach and choose Webpage. A lot of web-based emails are plain, simple, no frills - Attach file and that's it.
    So I need to have my client be able to do the same thing I do when sending out emails, Namely sending out emails with an Electronic Press Kit (EPK) attached - which is to say, a webpage (not a pdf in our case). So, I need her to download, install, and use Thunderbird.
    Here's the problem and my question. She needs to access, send, and receive from my email account. That would be easy if it was simple attach files - she could just login on the web, go to squirrel mail and bang it out.. Here it is: She needs to be able to import the messages to be able to reply to some messages - she needs access to what I have access to. She needs to use Thunderbird so she can take advantage of the features like insert image with link or attaching a webpage. My question is how will this affect my use? Can 2 people simultaneously and from different locations access and use the same email account or is it a case where her importing the emails would cut me off..Is it an either or thing? Basically, can her and I both import the emails or can they only be imported to one location at a time. Because every time someone sends me an email i get it right there on my Thunderbird application..it's imported to my Thunderbird..I want her and I to be able to do that without affecting each other. I don't want her to start importing to her desktop and then I can no longer import. If she says "point those messages to my computer what will happen to my ability to access them on my computer in the same manner I am currently?

    I think there is a contradiction in your requirements. You want two people to share an account and you don't want either to interfere with the other.
    The short and simple answer is to use IMAP to connect to the mail server. If your current email provider doesn't offer IMAP, find another that does. This is old technology already and it's disgraceful that some email providers haven't yet put it in place.
    IMAP means that your messages are stored on the server and both of you will see exactly the same set of messages. And therein lies the contradiction; you will both see changes made by the other so you are inherently interfering with one another.
    Caveats: some providers may not permit you both to access the account concurrently, and even if they do, things may become interesting if you both choose to work on the same message simultaneously.
    Note that all of this is about email servers and protocols; your choice of Thunderbird as your email client has little bearing on the situation.

  • As of yesterday 3/1/2015 T'bird stopped reading mail rationally on ONE of my two Windows 7 PC's and when aksed to check for new email retrieves the SAME message

    no matter how many times I ask T'bird to check for new mail I get back ANOTHER copy of the same message dated 7:28am and NO MAIL received after that reaches my INBOX. On my other PC running Windows 7 only ONE copy of the 7:28am transmission arrives as does all subsequent email sent to me at this address... both PC's are protected by Avast anti-virus software. Turning the rogue PC off and on did not help nor did uploading and installing an updated version of T'bird.

    Are the setup the same? same accounts, same folders, same messages, same filters same add-ons?
    If that the case make a copy of the good profile and replace the bad one with that.

  • HT201272 I am trying to down load a movie from Itunes on my ipad but as the download is complete an error msg appears stating download error. I've tried downloading 4 times and the same message. What could be wrong?

    I am trying to down load a movie from Itunes on my ipad but as the download is complete an error msg appears stating download error. I've tried downloading 4 times and the same message. What could be wrong?

    Hello VernonMartin,
    Thanks for the question, and welcome to Apple Support Communities.
    If the error includes a specific code, you can cross reference with these articles:
    iTunes: Possible iTunes Store errors
    http://support.apple.com/kb/ts1424
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    Thanks,
    Matt M.

  • Every time I sync my itouch I get the following message - "iTunes could not back up the iPod because the backup was corrupt or not compatible with the iPod.  Delete the backup for this iPod, then try again." But I get the same message again.... Any ideas?

    Every time I sync my iTouch I get the following message - "iTunes could not back up the iPod because the backup was corrupt or not compatible with the iPod.  Delete the backup for this iPod, then try again."  However, when I follow these instructions, delete the backup and try again - I get the same message.  Any ideas what is wrong?

    Hi,
    Try this thread.    https://discussions.apple.com/message/12661408?messageID=12661408
    Carolyn  

  • Can anyone help me ? my iphone 3gs keeps displaying needs activation and connect to itunes when i do this nothing happens but the phone works fine but as soon as i disconect the phone it displays the same message over again and wont let me go any further

    my phone has just suddenly stopped working today was fine this morning then suddenly showed a message saying needs activating and connect to i tunes . i connected it to itunes and nothing happened but phone started to work fine  so i disconected it from the laptop it worked fine untill it went to lock then showed the same message again .please can anybody help as i am ready tear my hair out!

    In settings>general> cellular do you have it  turned ON?

Maybe you are looking for

  • How do I split off my Ipad and Ipod from my wifes account that we have both used without loosing all my music, films and apps?

    I currently have an Ipod Touch and Ipad 2 wi-fi that were linked to my wifes account on her computer, she has an Iphone 4, Ipad 2 wi-fi + 3G and an Ipod touch. Over the years we have combined our joint music collections on to 1 itunes account - Silly

  • HOW TO: Use Input tags to edit records

    The question has been asked, "What does using the BC4J Input data tags provide over standard HTML input fields?" It is true that either type of input field allows your JSP to take user input and update your BC4J datasource. Both types of input fields

  • Beginner's JSF problems

    Hi - I'm a beginner at using JSF. I've worked with Java and Struts, and I'm comfortable with Netbeans. I'm working through some example code from one of the JSF books and I'm having the following problems: 1) The following code simply doesn't work...

  • Regarding overwriiten powerpoint file

    yesterday evening i overwrite the PowerPoint file on my desktop,through which all ppts got over written.I want the older version of that file .please help. 

  • ORA-01248: but we dont have the archivelog

    Hi, This a production box and it is high priority and we are already behind. We need to do a PIT restore of PROD database and export out couple of tables and import them to production. All i did was started a PIT restore and recovery of production da