Tip: Stopping listener in response to a Message

I wanted to control a standalone server using JMS messages. For instance, tell it to suspend processing or shut down.
But you can't call Connection.stop() from within a MessageListener - it throws an IllegalStateException. So I found a little trick that got me over - do it from a different Thread.
public class ServerMessageListener implements MessageListener
    static ServerToolkit toolkit = new ServerToolkit();
    public void onMessage( final Message inMsg )
        try  {
            ServerCommand cmd = ServerFactory.makeCommand( inMsg );
            if( cmd != null )  {
                if( cmd.getType() == SUSPEND_CMD :  {
// TODO browse broker to purge any other Suspend messages 
                    toolkit.console("  ML received Suspend message.  Stopping connection.");
                    new Thread() {
                        @Override
                        public void run() {
                            try {
//                                      sleep(50);
                                toolkit.getConnection().stop();
                            catch( Exception ex ) {}
                    }.start();
      catch( Exception ex ) { ex.printStackTrace(); }
      finally  {
          try {  inMsg.acknowledge();  }
          catch( JMSException ex ) {  ex.printStackTrace();  }
}Now I have to figure out a way to get it to resume...

Hi,
I don't think you'll be able to achieve this natively in Lync. The only thing that comes to mind is to define a custom presence state that you could have Tier 1 Help Desk change to in the event of this happening. This would only be a proactive measure though,
and not reactive in providing an auto response.
Looks like you'd either need to jump in and create something leveraging the Lync API's yourself, or see if there's an auto-responder / bot plugin out there already that can do this for you.
I'm not familiar with any myself, but top of a quick google-fu moment pulled up
http://lyncauto.blogspot.co.uk/
I must stress I've never used this, but its this type of app that might offer you the functionality you're after. I'm sure others here might be able to recommend something that's proven.
Kind regards
Ben
Note: If you find a post informative, please mark it so using the arrow to the left. If it answers a question you've asked, please mark the thread as answered to aid others when they're looking for solutions to similar problems or queries.

Similar Messages

  • Urgent : MDB stops listening to the queues after some time  !!!

    Hi,
    I am using OJMS with OC4J 10.1.2 and db 9.2.0.5. I have a web application which send messages into the queue very frequently.
    But the problem is the MDBs stop listening to the queues after some time (1-2 days) and no more messages will be dequeued from that point.
    All these messages will move to the exception queue after their expiry.
    But the dequeing agains resumes after restarting the OC4J !.
    I guess, at some point mdbs are either becoming busy (locked ) or some exception occured while dequeing, hence they stop listening to the queues.
    Please throw some light on this issue as it is very crucial in my project.
    Regards
    Prashanth

    I've noticed this lately as well, with my iPhone 4. I couldn't confidently pin it directly on any particular iOS update, but my iPhone used to automatically connect up via Bluetooth with my Prius's handsfree feature, and now it doesn't. I work with a CE-based device at my job, with Bluetooth capability, and I used to test out that feature by having it discover my iPhone. This no longer works either.
    What I have found (not really a solution, but it does work and may be a clue for Apple) is that if I simply go to the Settings app then the General -> Bluetooth screen and let it sit there, it will pair right up with my car within a few seconds. Bluetooth is always on, and always says "Now Discoverable" at the bottom of the settings screen.

  • Iphone freezes when listening to music and SMS messaging

    I've had my iphone lock up on me a few time now and it only happens when i'm listening to music and messaging at the same time. i don't think that i would have to stop listening to music to message. anyone else have this problem?
    And also, when i'm browsing the web on the phone it sometimes just quits to the main menu. any ideas?

    No.

  • Issues stopping Listener

    Hi all,
    We currently have an issue on one of our production database servers. We perform a cold backup of the database every night, stopping the db & the listener, making the backup, then starting both again. Occasionally (Once a week) we have an issue where the Listener seems to "lockup" on shutdown. IE the process lsnrctl stop LISTENER is just sitting in the process queue. Has anyone seen this happen before? We are running 10.1.0.3 on Redhat Enterprise AS 3 Update 5.
    Thanks
    EDIT: The following is the output that is captured from the Cronjob when the process locks up:
    LSNRCTL for Linux: Version 10.1.0.3.0 - Production on 19-DEC-2005 02:06:11
    Copyright (c) 1991, 2004, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
    Message was edited by:
    user474417

    The listener is simply a device to watch on the network for service requests. If a network request comes in, the listener checks whether it knows about the service and, if so, it asks the service provider to establish a connection to the requestor. After the provider and requestttor have been brought in touch with each other, the listener gets out of the way.
    One possible service provider is a database. Others are the external jobs that can be called from the database, and also [in 10gR2] the EPG which replaces the Apache HTTP server for HTTP as well as FTP and DAV requests.
    One listener can listen on behalf of any number of databases and other services on that box, in part because it really doesn't do anything other establish the initial connection.
    If the database service is self-registering (does not have an entry in the listener.ora file and does have a LOCAL_LISTENER=xxx setting in the init.ora or spfile.ora) then shutting down the database will ensure the listener will not attempt a connection for that instance.
    Shutting down the listener does not kill any existing connections, just ensures no new ones will get through - if the instance is up.
    I would not worry too much about the missing last line - it should not have a negative effect on your backup. Worth monitoring that your listener does start up properly though.

  • I have a Galaxy SIII and I stopped receiving visual notification for text messages.  How do I correct it?

    I have a Galaxy SIII and recently stopped receiving visual notification for text messages.  How do I correct it?

        Hmmm that's strange TopDiver. Let's get to the bottom of this. Have you checked the notification settings on the device? To verify the notification setting on the device click on menu>settings>sound>notification sound, then test device notifications.
    Thank You,
    MichelleL_VZW
    VZW Support
    Follow us on Twitter @VZWSUPPORT

  • When I try to sync my iPad and iPhone it will get within the last 3 pictures then stop giving me an APPCRASH error message. Then iTunes will shut down. No matter what I do to increase or decrease the number of pictures it always stops 3rd from the last.

    When I try to sync my iPad and iPhone it will get within the last 3 pictures then stop giving me an APPCRASH error message. Then iTunes will shut down. No matter what I do to increase or decrease the number of pictures it always stops 3rd from the last.
    Problem Event Name:             APPCRASH
    Application Name:                  iTunes.exe
    Application Version:               10.4.0.80
    Application Timestamp:          4e262cfr
    Fault Module Name:               QuickTime.qts
    Fault Module Version:             7.70.80.34
    Exception Code:                     c0000005
    Exception Offset:                    00146b30
    OS Version                                                            1033
    Locale ID:
    Additional Information 1:          0a9e
    Additional Information 2:          0a9e372d3b4ad19135b953a78882e789
    Additional Information 3:          0a9e
    Additional Information4:          0a9e372d3b4ad19135b953a78882e789
    Any assistance I can get will be greatly appreciated.

    Thank you iTunes for fixing the problem of downloading my pictures to my iPad and iPhone with the update 10.5.0.142

  • HT204406 hi!!!! I keep getting an "error" when trying to activate my iTunes match. I get to the 1st step, then it gets stopped, and I get the error message. HELP!!!!!!

    hi!!!! I keep getting an "error" when trying to activate my iTunes match. I get to the 1st step, then it gets stopped, and I get the error message. HELP!!!!!!

    That's definitely enough to start.
    It sure seems like it should work...and then I saw that you're using a router. It could very well be that the router is the weak link here.
    Instead connecting to your network router, try using a direct USB connection from your MBP. If that doesn't work, you read this post, which may be relevant to your problem:
    http://h30434.www3.hp.com/t5/Mac-Printing-and-Scanning/Scanning-from-Mac-10-7-fa ils-after-all-recommendations-Not-ready/td-p/1287003
    It seems you're up to date with software. Post with your results.

  • Itunes stops working and sends me a message that windows is checking for the problem. I uninstalled and reinstalled itunes. It works for a while then problem resurfaces.

    I tunes stops working and I get a message stating that windows is checking for error. I uninstalled and reinstalled .. Any hints...

    See Troubleshooting issues with iTunes for Windows updates.
    If you haven't already done a complete uninstall of all iTunes components, folder wipe and reinstall please try that first. Otherwise please post back with the exact text of the error message next time it occurs.
    tt2

  • Can i put an unavailable message as a response to text messages so people who are texting me will know that I am unavailable and for how long?

    I'm going to be out of the country for a few weeks.  I have an iPhone 4s.  Can I put an unavailable message as a response to text messages so people who are texting me will know that I am unavailable and for how long?

    No. Sorry. Check with your carrier. Perhaps they offer such a service.

  • JCoIDoc.Server doesn't stop listening even after removing the application

    Hi,
    I developed a java application with a JCoIDoc.Server to listen for IDocs from the R/3 system. I made it available in the WAS 2004s server. The application is working fine, i.e its catching the IDocs coming from R/3. The problem is, it doesnt stop listening even if i remove the application from the server.
    How should I make the server stop listening?
    Thanks,
    Venkat

    Hi,
    You need to call the disconnect method to release the connection from the server
    JCoIDoc.Server t; // Your Server Instance
                t.disconnect();
    Why dont you use  JCO RFC Privider Service?
    Regards
    Ayyapparaj

  • TS1702 I renteda movie (the last song) after 13 minutes it stopped and I recieved the following message "AN UNKNOWN ERROR OCCURRED (-50)". What can I do?

    I rented a movie (The last song) after 13 minutes it stopped and I recieved the following message "AN UNKNOWN ERROR OCURRED (-50)" .
    What can I do in this case?

    Perhaps try the "Error -50," "-5000," "8003," "8008," or "-42023" section in the Specific Conditions and Alert Messages: (Mac OS X / Windows) section of the following document:
    iTunes: Advanced iTunes Store troubleshooting

  • Why won't my videos play? They start on the device that they are on, then stop and I get an error message...An error occured loading this content.

    Why won't my videos play? They start on the device that they are on, then stop and I get an error message...An error occured loading this content. This comes up on all of my computers. I reset the Apple TV to Factory Settings and still get the same message.

    Hi There,
    I had the same problem took me several hours to try and sort it out but nothing worked.
    I then went to the following apple link
    http://support.apple.com/kb/TS5376
    Follow everything to a T and you will get the use of your Itunes again.
    Hope this helps. Good luck (And remember to breath lol )

  • Why does siri stop listening so quickly, I cant even finish my question or command half the time before it starts trying to search

    Most of the time siri works fairly well, but there are a good amount of times where it just stops "listening" and starts searching. Like ill say Find directions to...and it jumps ahead and starts searching before i can say where i want directions too. ***.

    There are a few reasons why siri will stop listening:
    1. It is having problems connecting to the network so can't search for what you are looking for. You are prompted with something like: I am sorry I can't connect right now.
    2. There is a pause when you are dictating something to siri so it assumes you are done. Pauses of about 2 or 3 seconds should do it.
    3. You accidentally press the siri button indicating you are done dictating to siri.
    If none of these are the problem, I don't know what else to do. How often is this occuring?

  • I purchased the movie Wrath of the Titans. It stop downloading and gave me a message  unknown error occurred -50 . How do I fix this problem to continue my download?

    I purchased the movie Wrath of the Titans. It stop downloading and gave me a message  unknown error occurred -50 . How do I fix this problem to continue my download?

    Perhaps try the "Error -50," "-5000," "8003," "8008," or "-42023" section in the Specific Conditions and Alert Messages: (Mac OS X / Windows) section of the following document:
    iTunes: Advanced iTunes Store troubleshooting

  • How do you listen to a voice mail message a second time?

    How do you listen to a voice mail message a second time? When I try to listen, nothing happens.

    Tap the play button next to it.
    iPhone User Guide (For iOS 4.2 and 4.3 Software)

Maybe you are looking for

  • Can't install Firefox on Windows 7 home premium. Get a Security warning "Unknown publisher".

    Tried downloading from link below: http://www.mozilla.org/en-US/firefox/all.html It downloads, but a internet explorer security waring pop up stating Name : Firefox%20Setup%207.0.1.exe Publisher: "Unknown Publisher". If I click Unknown Publisher, it

  • Acrobat Professional hangs when converting word to PDF

    I am using Acrobat Professional version 7 and when i use the Convert to PDF option for a large word document it goes through the motions of converting the document but then seems to hang and i get no PDF document created. Also the Word document then

  • [SOLVED] Monitor out of frequency while installing

    Past week I completed my first Arch Linux install in a laptop and everything works flawlessly, so I decided to install it also in my desktop computer. I boot from the CD, choose "Boot Arch Linux" option, some boot messages appear, some services start

  • Remove underscore from buttons, add Alt text

    Hi, Thanks in advance for your help. I am having more problems with the RH's Govt template. The forward and back buttons would not appear, so I have created my own buttons and incorporated into my user guide. However, there is an underscore appearing

  • Golden gate extract from multiple oracle db's on different servers

    Hello, I am new to golden gate and I want to know if is it possible to extract data from an oracle database which is on a different server? Below is the server list Linux server 1: has oracle database (11.2.0.4) (a1db) and golden gate installed (11.2