Time of callback: Asynchronously receiving messages using a listener class

I was developing a small JMS client that registers a message listener for receiving text messages from a JMS provider. The program is single threaded.
I wanted to know when exactly the "onMessage" method is invoked for processing received messages. My client could be performing other processing tasks after registering the listener. In such a scenario, on arrival of a message, when does the program flow jump to the onMessage method? Is it as soon as a message arrives (in which case, the client could be abruptly interuptted in the midst of some processing/system call) ? If so, does the execution return to the exact point of interuption after the onMessage method returns? Or does the java runtime environment implicitly spawn a thread for processing the message?
If the answer to my questions is the former, then does it mean that such clients are best written as multi threaded programs??
Any pointers on this aspect would be greatly appreciated....

Hi,
Even if the JMS specification says that a session is single threaded, asynchronous messages are processed within their own thread. As a programmer (a JMS API user) you don�t have to worry about implementation details. The only thing you have to know is that:
1) Your JMS server pushes messages to your asynchronous listeners upon availability
2) Asynchronous messages are sequentially processed on the session level (concurrency is achieved by using several sessions)
3) Using ExceptionListener allows a client application to be asynchronously notified of a problem (this is useful to do some cleaning or reconnection operations)
I hope this helps
Arnaud
www.arjuna.com

Similar Messages

  • How to receive messages using my iPad number than receiving messages from email

    HOw do I receive messages using my iPad number not my email address

    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

  • Using ipad2 wifi,cannot send or receive  messages using messages , running ios5

    ipad2 wifi,cannot send or receive  messages using messages , running ios5

    Problem solved
    Changed DNS settings to google public settings
    8.8.8.8

  • How do I get my iPad to receive messages using my iPhone number? I could do it before the update.

    I have recently updated my iPad mini and iPhone 4S to 7.0.4.  Since then I have not been receiving or seeing messages I have received or sent. If I was to dend a message using my phone then I could see it on my iPad as an example. But I cannot now. Any ways to rectify this? 

    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

  • How can I transmit and receive messages using Vector CANTech CancardXL with LabVIEW?

    I'm a new LabVIEW user and I need transmit and receive CAN messages using a CancardXL from Vector CANTech with LabVIEW.
    Could somebody have any vi or suggestion?

    I made a set a LabVIEW VIs to work with Vector/Softing CANCards starting from an example program I downloaded from Softing. These use the Call Library Node to interface with the cards .dll.
    I can't give these out because they were developed for a customer. I would contact Vector and see if they have an example program for your card. Might be the same one I started with.
    [caution, salesman hat going]
    Of course if you need help developing the VIs, we'd more than happy to assist you.
    [remove saleman hat]
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Send and receive message using J2me

    Hi All
    I m new to j2me and it is my first professional task i will vary thankfull if you peoples will help me
    Scenario is that like bank client will send account number to some mobile number. Mobile that receives(connect to server via usb or if u have any other idea please guide me ) this message will search database and retrieve result and send result back to the client.
    i will vary thatfull for your responce
    thanks in advance
    Shahzad
    Software Engineer
    Allianz EFU

    Hi, i currently working in a sms company, i think i can give u some picture~
    ur scenario is, u wan a mobile user, to send a sms to bank, in order to perform someting. it will going to be like this
    FIRST, u have to go to the mobile service provider (those company who offer u the mobile number), they will having a API that able to communicate to their SMS Inbox (just like ur email inbox)
    SECOND, u have to apply a SMS Inbox at the mobile service provider with a short code given (see example below).
    THIRD, u just develop a java application using the API the mobile service provider gave, when a sms is sent into that sms inbox, a trigger to ur application, and the msg can retrieve. it can be so easy like just receiveSMS(), you will get the sender phono number together with the sms content, take it and process whatever u like. after that, u can send the sms back to the user, using the same API provided by the mobile service provider too-- sendSMS(sender_mobile, content).
    user sent a sms with the content "XYBANK BALANCE <account no> <password>" and send to 8885555 (example)
    where
    XYBANK = shortcode (actually represent the sms inbox name, just like ur email address)
    BALANCE = ur own decide code, when u receive the sms, u split the msg, if u found "balance", then go to the db and take out the balance of the particular account no.
    hopefully it will give u a brief pic how this thing can work. btw....if u develop for the academic purpose only...i dont think the mobile service provider will give u the API.... >.<
    Message was edited by:
    e-Biau

  • I have a MacBook Pro running OS X Version 10.68.8 I have download adobe flash several times and I still receive message Block plug in

    I have downloaded Adobe Flash and I am still getting message Blocked Plug In

    1. System Preferences >  Flash Player > Advanced >  Delete  All
         Press the "Delete All" button
         Install Adobe Flash Player.
        http://get.adobe.com/flashplayer/
        Follow the prompts.   Click Safari in the menubar and select “Quit Safari”.
        Restart computer. Relaunch Safari.
    2.  Allow  Plug-ins/ Enable Plug-ins
        Safari > Preferences > Security
        Internet Plug-ins >  "Allow  plug-ins"
        Enable it.

  • Thunderbird updated overnight and now I cant receive messages using the same settings?

    Thunderbird new release 31.5.0 (downloaded last night) connects to the POP server but does not download the messages from the server.
    Previous releases were working fine and downloading messages.

    Please read this anwser and see if it works for you.
    * https://support.mozilla.org/en-US/questions/1048624?utm_campaign=questions-reply&utm_medium=email&utm_source=notification
    If it does nnot work then report back in this question.

  • Asynchronous Consumer Message Size Limitation?

    Hello,
    We are currently evaluating the Sun Message Queue 3.5. We are able to successfully send and asynchronously receive messages that are less than 1K. However, when we increased the size of the message to 2K or more, the asynchronous consumer does not return the message and messages that we send subsequently (large or small) do not get received. Seems like the destination is blocked at that point. We are able to retrieve the message synchronously though using the receive(1000) method.
    Is there maybe a setting that we must check out for this?
    Also, is it possible to support both synchronous and asynchronous messaging at the same time?
    ie. Creating MessageListeners and also using the receive method for the same set of destinations?
    We were planning to use this as a workaround so that if the message is greater that 1K, we'll just receive it synchronously. However, synchronous receiving doesn't seem to work if there is a listener listening to a destination that contains a large message.
    Thanks for your time.

    Outside of specific configurable parameters, nothing in
    the system really cares about the size of the message.
    A few possible reasons:
    1. if you are using receive(timeout), the receive time may
    be too short to complete processing the message (since
    larger messages take longer to send over the network)
    2. if you are setting an expiration time, the larger messages
    could be expiring during the routing stage (since the
    messages take longer)
    3. The larger messages could be exceeding a configured
    size limit on either the destination or broker
    To check:
    imqcmd query dst -n <name> -t t
    or
    imqcmd query bkr
    And look at the size limits
    If the size limits are exceeded, the messages will be rejected.
    Additionally, if

  • I can't receive messages, I keep getting the message "connecting to POP.verizon"

    Any time I try to receive messages, I get the notice at the bottom of the page that it's connecting to POP.verizon.net. However, it never connects and I have no idea how to receive messages. I have tried several different troubleshooting solutions, but with no success.

    https://support.mozilla.org/en-US/kb/problems-sending-and-receiving-messages
    You didn't mention what exactly you tried already.

  • How can i send and receive messages through CAN

    Hi,
    how can i send and receive messages using Vector CAN CARDXL

    As mentioned in this forum post, if you have a dll, this can easily be called from LabVIEW or CVI.
    I also went to the vector website and it does look like they have LabVIEW drivers available for download.
    Peter Flores
    Applications Engineer

  • Please, I hd not paid my adobe plain, so, it´s canceled ... ok ... but just on few days I paid. My payments, today is OK, bur, all the time I opened my sotwares, I receive messages talking about I have, only, few days to use my softwares ... like "You hav

    Please, I hd not paid my adobe plain, so, it´s canceled ... ok ... but just on few days I paid. My payments, today is OK, bur, all the time I opened my sotwares, I receive messages talking about I have, only, few days to use my softwares ... like "You have 02 days to expire your Adobe CC" ... I try reload my computer  ... and many others ways to resolve this case, but I didn´t have successul ... Someone help me? Tks!

    You had purchased CC on 01/24/14 which was cancelled & then you again purchased CC 9/7/14, the error message that you are recieving is due to the cancellation as the server is trying to remind you, please log out & log back in of the CC desktop app to activate the new cc . The issue should be resolved.
    You have 20 GB of space allocated indicating you have active CC.
    Regards
    Rajshree

  • When is a message considered as received when using Near Field Communication?

    Hi there!
    I'm using Near Field Communication(NFC) in my app(it's a game) and I just want to send very simple messages so the regular NFC tap suffices.
    I've read the documentation and went through the proximity sample and I understand what I've to do to make this work, so no problems so far.
    The thing I'm struggeling with is the following: I would like to send a message using NFC to a particular player in my game.
    Two players are connected to each other and only those two should be supposed to be able to send messages to each other using NFC.
    These messages do not contain any secret information so I can use the "Windows." format as tag to subscribe to and send messages with.
    I came up with the idea to subscribe for a tag that's basically your userId and publish messages with a tag that consists out of your opponents user_id. All of that works fine the thing is, I use the MessageTransmitedHandler and MessageReceivedHandler, the
    one is raised when you've succesfully transmited the message and the other one when you've received a message.
    These callback functions make sure that you only send a message once and receive it once by using the StopPublishingMessage and StopSubscribingForMessage functions. And here's the catch, I only want to call these functions if you actually "consume"
    the message you receive! And stop publishing a message when the correct opponent received it.(This is to make sure that if multiple users are in the same room for example that only the one's related to each other can tap each other's devices).
    Right now the callback function will always stop publishing the message, or subscribing to a message even if you tapped the wrong user.
    I'm not 100% sure but I do believe this is because the callback function is called no matter if the other device really "consumed' the message.
    So my question is, is there a way to determine if the opposing side actually "consumed' the message? If there's no built in function for this(which I think there isn't after I went through the documentation) do you guys have any idea how I could achieve
    the behaviour I want?
    I hope my message isn't too confusing, if it's feel free to indicate that and I'll try to clarify those parts.
    Thanks in advance!
    My best regards
    Jan

    Proximity is a great way for users on tow devices to share your app experience and data. You can establish a connection between two peer apps at one time as I know. This quickstart describe it in detail,
    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh465205.aspx. If one user want to communicate with a third user, his app need to connect to that one first.
    If I'm not mistaken this sets up a WiFi or Bleutooth connection, I'm not really looking for that since the message I wish to send is really really short and NFC is perfect for it. It seems like a hassle to me to set up such a peer to peer connection just to
    be able to identify if the message has been received by the correct user.

  • Asynchronous subscriber is not receiving messages

              Hi,
              I have a problem with stand alone asynchronous subscriber.The asynchronous subscriber
              is not receiving messages even though there are messages published to the same
              topic to which this subscriber has subscribed.
              When i run asynchronous subscriber it should wait indefinitely to receive messages
              but this subscriber waits for some time and exits. iam using weblogic7.0 sp3.
              Thanks in advance
              venkat
              

              venkat wrote:
              > If that is the case say ,I have a publisher publishing messages to a topic and
              > an Asynch Subscriber subscribing to a different topic..The publisher is publishing
              > messages in the main method.Your explaination given below implies that the application
              > will exit once the publishing is completed,Then i think the purpose of having
              > asynch subscriber is defeated.
              I think WL JMS has had this behavior since version 4.51? At
              least since 6.0. You are the first I recall ever desiring
              this behavior. You are welcome to file an enhancement request
              with WL support.
              > And i have tested this with all the popular JMS
              > providers(which are JMS complaint) available in the market.And the code which
              > i have posted works perfectly with all the JMS providers..
              I think we need to agree to disagree here. You are depending
              on a side-effect that the main() can't exit until all async
              consumers are closed. This behavior is not defined in the JMS spec.
              BTW, there is JMS compliant and then there is JMS compliant. I can
              easily list a good many significant failings of "JMS compliant"
              vendors. I don't intend to spread FUD, but want to make
              the point that "JMS compliant" does not come even close
              to meaning "tested" or even full compliance with JMS spec - it
              just means that the vendor (may have) passed the (relatively basic)
              Sun compliance tests.
              >
              > Tom Barnes <[email protected]> wrote:
              >
              >>The code you posted has nothing to stop the "main" from returning, which
              >>would cause the program to exit as soon as its finished
              >>setting up its subscription. This is expected behavior.
              >>Java is supposed to exit when the main returns.
              >>
              >>If the program works on other JMS vendors, then they
              >>must be "helping" you by creating one or more Threads that won't
              >>allow the program to exit until their threads exit. I actually
              >>find this "help" to be surprising behavior - because control of JVM
              >>process has been taken away from the client code. I wouldn't
              >>be surprised if this violates the JMS spec.
              >>
              >>To match the behavior you desire in your current program, put
              >>a "Thread.sleep(Long.MAX_VALUE)" at the end of your main().
              >>
              >>venkat wrote:
              >>
              >>
              >>>Hi,
              >>>Iam attaching the source for the asynch subscriber..The same piece
              >>
              >>of code works
              >>
              >>>with other JMS Providers.
              >>>
              >>>Thanks
              >>>Venkat
              >>>
              >>>Tom Barnes <[email protected]> wrote:
              >>>
              >>>
              >>>>This, of course, works. Otherwise we would have a lot
              >>>>of unhappy customers. Make sure that your could
              >>>>is (A) calling connection.start(), (B) setting
              >>>>its message listener, and (C) creating the subscriber
              >>>>BEFORE the messages are published.
              >>>>
              >>>>venkat wrote:
              >>>>
              >>>>
              >>>>>Hi,
              >>>>>
              >>>>>I have a problem with stand alone asynchronous subscriber.The asynchronous
              >>>>
              >>>>subscriber
              >>>>
              >>>>
              >>>>>is not receiving messages even though there are messages published
              >>>>
              >>>>to the same
              >>>>
              >>>>
              >>>>>topic to which this subscriber has subscribed.
              >>>>>
              >>>>>When i run asynchronous subscriber it should wait indefinitely to
              >>
              >>receive
              >>
              >>>>messages
              >>>>
              >>>>
              >>>>>but this subscriber waits for some time and exits. iam using weblogic7.0
              >>>>
              >>>>sp3.
              >>>>
              >>>>
              >>>>>Thanks in advance
              >>>>>
              >>>>>venkat
              >>>>
              >
              

  • I can't connect to the drive on my airport time machine and am receiving the message: "AirPort Time Capsule" can't be opened because the original item can't be found.

    Time capsule has been working perfectly for months.
    Suddenly I can't connect to the drive on my airport time capsule and am receiving the message: “AirPort Time Capsule” can’t be opened because the original item can’t be found.
    Time machine appears to be still backing up (last backup within the last hour), but drive is not visible and I have files stored on it.
    I have tried rebooting everything in order as suggested for other issues, anyone got any ideas how to see the drive again??

    What OS are you running??
    It is very typical Yosemite issue.
    1. In airport utility does the TC show up.. if so click it.. and see the summary page which will include its IP address. That is what you are after.
    From my screenshot you can see the TC address is 192.168.2.57
    It might well show up briefly after a reboot or in ipad / iphone version utility. Yosemite is hopeless. The airport utility hardly works.
    2. In Finder use Go, Connect to server.
    Type in SMB://192.168.2.57 (replace with IP you discover).
    If it is possible it will request a password.. type that in and DO NOT FORGET.. to store it in your keychain.
    This will work until the TC changes IP which won't happen if it is main router.. but will happen if it is bridged.. so you need to tell me the whole network setup.
    Mavericks is nearly as bad and the above instructions should be universal except I would use AFP instead of SMB. Apparently Yosemite is now totally Windows oriented.

Maybe you are looking for

  • JME development with JDeveloper

    Hi all, I´m a mobile application developer and I´ve been using Eclipse + EclipseME to develop my applications. But, I´m trying to use JDeveloper with JWE but I´m having some problems. Does anyone here are using JDeveloper + JWE to develop mobile appl

  • For those with battery drain / wifi issues

    Many of you have found a temp fix related to exchange email accounts, this is not for you and I'm glad you have found something that seems to be working. For those of you with battery oddities, something new to try... See what security protocol your

  • How to map qualifiers?

    Hello, I am new in MDM and have (hopefully) a basic question: I have issues in the import manager. My target table is the table “Products” (source is an Excel file). I am facing issues to import the price data. The sub table price is a qualified look

  • Why do I have duplicates in my iTunes library when I have only a single file for each song on my PC?

    I have duplicates for about half of the songs in my iTunes library. I've recently upgraded to a new PC so I'm assuming that it occurred at that point. However, when I go in to my iTunes media files I only once copy of each album or song filed. Also i

  • 12 Cell Battery for HP dv6-1050 us Entertainm​ent Notebook

    What is the proper battery to purchase for this type of notebook?