Creating a QueueReceiver after sending message to the QueueSender

          Hi,
          I'm implementing a blocking system, sending messages to a JMS Queue.
          In a servlet, in the init method, I'm creating the QueueSender object.
          When calling the servlet, in the service method, if I need to create a new
          message to let users know
          that one primary key is blocked, I create a message with a:
               msg.setStringProperty("MyTablePrimaryKey", "PKValue");
          Then, I send it.
          If other clients want to update that record, he creates in the servlet's service
          a QueueBrowser like this:
          QueueBrowser receptor=qsession.createBrowser (myQueue, strFilter);
          where strFilter is "MyPrimaryKey IS NOT NULL".
          If the enumeration my QueueBrowser returns hasMoreElements(), the record is
          blocked.
          To unblock a record, I fetch the message from QueueBrowser with the with Enumeration.nextElement,
          and I set:
          message.setJMSExpiration(1);
          so the message is automatically deleted from the queue.
          I tried to use QueueReceiver to implement it, but as I don't know the filter's
          name in the init method of my servlet,
          it's not possible to read messages if the QueueReceiver is created after having
          sent those messages.
          Is my implementation correct? Is the behaviour of QueueReceiver logical?
          Of course, I'm thinking of doing all these things in EJBs to use transactions
          with JTA and JMS. Can be any problem
          with it?
          Sorry for the long question, but I've started discovering JMS a few hours
          ago, and it looks so interesting... :-)
          Best Regards,
          Ignacio
          

          Ignacio Sanchez wrote:
          > Tom Barnes <[email protected]> wrote:
          >
          >>
          >>Ignacio Sanchez wrote:
          >>
          >>>Hi,
          >>>
          >>> I'm implementing a blocking system, sending messages to a JMS Queue.
          >>>
          >>> In a servlet, in the init method, I'm creating the QueueSender
          >>
          >>object.
          >>
          >>> When calling the servlet, in the service method, if I need to create
          >>
          >>a new
          >>
          >>>message to let users know
          >>>that one primary key is blocked, I create a message with a:
          >>>     msg.setStringProperty("MyTablePrimaryKey", "PKValue");
          >>> Then, I send it.
          >>>
          >>> If other clients want to update that record, he creates in the
          >>
          >>servlet's service
          >>
          >>>a QueueBrowser like this:
          >>> QueueBrowser receptor=qsession.createBrowser (myQueue, strFilter);
          >>> where strFilter is "MyPrimaryKey IS NOT NULL".
          >>> If the enumeration my QueueBrowser returns hasMoreElements(), the
          >>
          >>record is
          >>
          >>>blocked.
          >>
          >>
          >>How? The QueueBrowser supplies a snap-shot of the queue, it doesn't
          >>prevent other receivers and queue-browsers from seeing the message.
          >>
          >
          >
          > That's exactly what I want. I want concurrent queue-browsers to see the same message.
          >
          >
          >>>
          >>> To unblock a record, I fetch the message from QueueBrowser with
          >>
          >>the with Enumeration.nextElement,
          >>
          >>>and I set:
          >>
          >>> message.setJMSExpiration(1);
          >>> so the message is automatically deleted from the queue.
          >>
          >>
          >>This will have no effect. Expiration can only be set when the message
          >>is sent, and only via the producer API not the message API. The message
          >>API setter is not intended for application use (see the
          >>javax.jms.Message javadoc). To delete the message you can
          >>create a QueueReceiver with a selector based on the message's
          >>message-id, then receive and acknowledge the message.
          >>
          >
          >
          > But it works!! I've tested once and again and it works fine for me. Shouldn't
          > it???
          >
          Gah!! This behavior is not supported. Do not depend on it to
          be there in future releases or SPs. Any changes to an already
          sent message by a client should propagate to the copy that
          is on the server.
          In fact, I think this may have already been fixed. Can you
          tell me which release and SP you are using?
          >>>
          >>> I tried to use QueueReceiver to implement it, but as I don't know
          >>
          >>the filter's
          >>
          >>>name in the init method of my servlet,
          >>> it's not possible to read messages if the QueueReceiver is created
          >>
          >>after having
          >>
          >>>sent those messages.
          >>
          >>I don't understand. If you can create the QueueBrowser when you
          >>need it, why can't you just create a QueueReceiver with a new selector?
          >
          > If I create a new QueueReceiver after having sent the message using a QueueSender,
          > the
          > receiver cannot read the messages already posted, even in selector is OK. But
          > it works with
          > a QueueBrowser ¿¿??¿¿
          If a QueueBrowser can see the message so should a QueueReceiver. They
          both use the same filter/selector mechanism. It is surprising
          that one worked and the other didn't. Or are you referring to
          the normal behavior that only one QueueReceiver can "see" the message
          at a time? And that once a QueueReceiver has a message the
          QueueBrowser will not "see" it?
          > That's why I'm using QueueBrowser and not QueueReceiver.
          >
          >
          >>>
          >>> Is my implementation correct? Is the behaviour of QueueReceiver
          >>
          >>logical?
          >>
          >>>
          >>> Of course, I'm thinking of doing all these things in EJBs to use
          >>
          >>transactions
          >>
          >>>with JTA and JMS. Can be any problem
          >>> with it?
          >>>
          >>> Sorry for the long question, but I've started discovering JMS a
          >>
          >>few hours
          >>
          >>>ago, and it looks so interesting... :-)
          >>>
          >>> Best Regards,
          >>> Ignacio
          >>
          >
          

Similar Messages

  • "Cannot send message using the server....."

    Hi all,
    Considering the nature of the problem I am about to relate I would have to say at the outset that I would be very very surprised if other people have not come across this problem, so here goes...
    We have around 60 users of Apple Mail from both 10.4 and 10.5, so varying degrees of versions of Apple Mail however most if not all are updated to 10.4.11 and 10.5.2.
    We have been plagued with people being frustrated about emails bouncing back with an immediate error which is basically the following...
    "Cannot send message using the server smtp.xxx.com:user
    Sending the message content to the server failed.
    Select a different outgoing mail server from the list below etc etc"
    I am sure a lot of you have seen this error.
    However, it is totally random but I am at the end of my tether with it. It generally revolves around emails with attachments and can be totally random. I was trying to send a screenshot today, very small screenshot, using the Apple-Shift-4 technique, sent the .png file, then saved it out as a .jpg, nothing. Tiny file, around 5k. Got the error above, took it out, sent no problem. Other similar files on the desktop refused to send but a .pdf did. I then thought it might be our server, so sent teh same attachments using my .mac account. Same result and failed to send. Reports from other users in our group show that they too get random results, maybe moving the attachment in the email makes it go, sometimes putting it before your signature, sometimes putting your signature copied and pasted in so many times makes it work, all sorts of methods but all resulting in the same conclusion, Apple Mail can be very unreliable.
    We have even migrated some users to Entourage and the problem disappears. Even to Thunderbird, but those users miss the search capability as it is quicker and more reliable. So they want to go back.
    Considering I have been struggling with this issue back in the day when we were on the Apple Mail related version in 10.4 I was hoping that the version released in 10.5 would remedy the problems. Sometimes I feel it has just got worse.
    Is anyone else experiencing this sort of difficulty in Apple Mail, I really feel isolated and at a loss with how to remedy this for so many users.
    If anyone can share their experiences and how they have got around similar issues in Mail I am all ears and open to any suggestions.
    Thanks everyone for taking the time to read through this. There is more but the experiences are so random it is not worth trying to put it all down.
    Thanks again.
    Gerry McCoy

    I went in to Connection Doctor and. oddly enough, for this Mac account it said I was on Port 25. Si I changed it to Port 587 and saved the changes.
    Still, I have the same problem with the same error messages.
    I go back to the mail preferences > Accounts > Advanced and it shows Port 143 still there grayed out.
    What about SSL - it's not checked.
    Odd that this problem only seems to be from one .mac account emailing to another .mac account. Could the server be down?

  • Cannot send message using the server (null)

    i use mail 2.1.
    i have a .mac account and have three other email accounts attached to my mail account.
    lately, i cannot send any email.
    the switchiing ports fix hasn't helped either.
    this is the error message:
    CANNOT SEND MESSAGE USING THE SERVER (null)
    The server response was: 5.1.0 <email [email protected]>...
    From address does not match authentication.
    Use the pop-up menu below to try a different outgoing mail server. All messages will use this server until you quit Mail or change your network settings.
    Message from: email <[email protected]>
    Send message using: [there is a combo box here with all the four accounts servers listed]
    no matter which one i pick it doesn't work and no email is sent.
    anyone have this error before? or now how to fix it?
    i'd be appreciative.
    thanks
    1.67 GHz Power PC PowerBook G4   Mac OS X (10.4.6)   Sony HDR HC3 HD HandyCam MiniDV

    I was having a similar problem (don't feel like typing all the details)
    I was about to to delete my com.apple.mail.plist, when finally it hit me.
    I ran ethereal (again, I'm sorry, but learning how to use ethereal is a topic unto itself). Following the TCP stream (ie. looking at the smtp messages being sent back and forth) I came across two problems. For some reason my port number was set to 567 or something like that, when it's supposed to be 25, as I had originally set it to.
    Once I corrected the port number I started receiving an error message from the smtp server. It said the return email address could not be authenticated. (using xyz.com as an example) The correct return email address was supposed to be [email protected], but for some reason it was changed to john@xyz in the account settings.
    Anyway, to get to the point, another thing to check is that your return address has been set correctly, and if all else fails, make sure you have X11 installed and use fink to install and run ethereal. This will let you know if you are actually connecting to the server, and will show you any error messages.
    PS. I think this problem started occurring with the last update made to mail. I believe it somehow corrupted my settings. This would explain how my port number could have been changed to the default port number of .mac mail.

  • OSX Mail - Cannot send message using the server ....

    Hi there,
    Mac Pro with OSX 10.6.
    *Can receive mail, but can no longer send email* using the program Mail.
    Been getting the popup "Cannot send message using the server [shawmail.vc.shawcable.net] for the past 3 days. I hadn't changed anything about my computer, and have had the Mac for 2+ years. So this just started doing it on it's own.
    I had a technical support guy from my service provider even interface with my computer, where he could see my desktop right over the internet, and he couldn't get it fixed either.
    I googled this problem, and found solutions like:
    1. Uncheck "Use SSL" (Done that, and it was never checked "on" to begin with)
    2. Make sure Authentication is set to none, with no password (done that, and it wasn't set with a password to begin with)
    3. Delete [user]/Library/Preferences/com.apple.mail.plist (done that, didn't do anything)
    4. We even totally deleted my account, and started a new fresh one. Didn't work
    The tech support guy did show me a way to email online, using the same email account. That worked, but it's a hassle to go onto a web-based email program -- it's not my preference. So, with great certainty, it's not my service provider, because I was able to send emails on this web-based email program using my email account.
    So there, I'm stumped.
    Hopefully someone can help. What's bizarre is that googling this problem, I have found many other people that say it happens arbitrarily, out of nowhere.

    I can't believe how ridiculous this issue is. i have been searching for days for a solution to this. i have tried EVERY recommendation on these forums and nothing works. It appears that this issue dates back to TIGER. I had this problem back in January and just bagged figuring it had something to do with iweb. I bought a new html program and was able to send out my newsletter last month no problem. Suddenly, one month later- here i am again, unable to send out my newsletter with no help from Apple or verizon, or these forims, or anyone else. To think that a company that I have stood behind and loved so much can't be be bothered fixing such a simple issue that has been going on now through  5 OS's (I am using Lion but I had the issue using leopard as well)  is a disgrace.

  • I tried to send a mail message to too many addees. when the rejection came back "cannot send message using the server..." the window is too long to be able to see the choices at the bottom of it. how can i see the choices at the bottom of that window?

    I tried to send a mail message to too many addees. when the rejection came back "cannot send message using the server..." the window is too long to be able to see the choices at the bottom of it. how can I see the choices at the bottom of that window?

    I tried to send it through gmail and the acct is  a POP acct
    I'm not concerned about sending to the long address list. I just can't get the email and window that says "cannot send emai using the server..." to go away. The default must be "retry", because although I cannot see the choices at the bottom of the window if I hit return it trys again... and then of course comes back with the very long pop up window that I cannot see the bottom of so I can tell it to quit trying...

  • Mail doesn't send e-mail. Before yesterday everything was ok, but now it says that a copy of the message has been sent to "Sending messages" because the contents of the message cannot be send to server. What to do? IMAP should be ok.

    Mail doesn't send e-mail. Before yesterday everything was ok, but now it says that a copy of the message has been added to "sending messages and the content of the message cannot be sent to the server". All the data in IMAP is ok. What to do?

    thanks for replying!
    When sending from one mac email account to another email account on the mac it seems to send fine, and it moves to the sent items, but nothing appears in the mac inbox.
    When sending from a mac account to the pc, it seems to send fine, and it moves to the sent items, but nothing appear in the PC inbox.
    When sending a massage from the PC to my mac email, it send fine from the PC and arrives in the inbox on the mac.
    mac to mac - seems to send but dosent arrive
    mac to pc - seems to send but doesnt arrive
    pc to mac - seems to send and arrives.
    As i said it was all working fine yesterday and for four years previous to that, but now it has just stopped.
    I hope you can help.

  • I have problem with my contacts.  I can't send message if the contact didn't send me a message before.  How can I add new address?

    i have problem with my contacts.  I can't send message if the contact didn't send me a message before.  How can I add new address?

    Hi tizac,
    You will want to add them to your Contacts. 
    There's a "+" button at the bottom of the contact list on the left to add a contact.
    If you need to add the email address or phone number to an existing contact, there's an Edit button at the bottom of the contact info (on the right).
    Once you have the contact email address or phone number you want to message to, scroll all the way down to the bottom of their information and there are options to:
    Send Message               FaceTime
    Share Contact             Add to Favorites
    Of course choose "Send Message" to send an iMessage to them and you will start a new chat.  You will be given the options of how to contact them, via phone number (if they are on an iPhone) or email (if they are on an iPod touch or iPad).   They do need to be signed up for iMessage or it won't allow you to send.
    ivan

  • "Could Not Send Message Using The Server...:

    I never have any trouble sending from Apple Mail, except now I am trying to do a mass-mailing for our business. Is there a limit on how many people you can BCC?
    For the 1st message I put 200 people in the BCC field, and the message sends fine. Then I setup the another message with the next 200 people, and the send fails. Get a notice that Apple "Could Not Send Message Using The Server SMTPOUT.secureserver.net". And gives me the option of selecting other servers, neither of which work either.
    I am curious, are there limits on how many people you can copy on one message?

    Most, if not all ISPs and email account providers have similar limits per the following for personal/non-business email accounts as part of an overall effort to eliminate or reduce bulk spam emanating from the ISP's or email account provider's domain.
    Any ISP or email account provider that doesn't impose similar limits is helping to contribute to the amount of spam that gets circulated.
    .Mac has several safeguards in place to ensure that only .Mac members send messages with the Mac.com outgoing mail server.
    Among them are reasonable limitations on:
    The number of messages that can be sent each day (200 messages)
    The number of recipients that can be sent to each day (400 recipients)
    The number of recipients a message can be addressed to at one time (100 recipients)
    There is also a 10 MB maximum size for messages sent or received using the .Mac mail system.

  • HT1277 I can recieve emails but I can't send them out.  The blue bar at the bottom left of the Mail page gets half way across and then the pop-up "Cannot send message using the server" comes up?  What do I do?

    I have my Yahoo Mail "poped" over to Apple Mail.  I can recieve emails but I can't send them out.  The blue bar at the bottom left of the Mail page gets half way across and then the pop-up "Cannot send message using the server" comes up?  What do I do?

    Your outgoing mail server is different than your incoming server. Usually the outgoing mail server will have smtp in it. I noticed yours said "cannot send message using the server mail.wavecable.com". That sounds like an incoming mail server. Try setting your outgoing mail server to smtp.wavecable.com
    I hope that helps.

  • Apple Mail Time Out / "Cannot Send Message Using The Server..."

    When trying to send messages of 5-10MB using my Apple Mail, it sends fine when on my home connection. But when on my (3G) mobile datacard, it seems to get half or 3/4s the way, but doesn't quite make it to the end, then times out with the message "Cannot Send Message Using The Server...". It seems that the Apple Mail doesn't allow enough time before deciding to cancel the attempted send. Is there a way to fix this eg by changing settings?

    I'm seeing something similar here (using an Exchange 2007 server -- SMTP works just fine). Unfortunately, I have no solution to offer. I would be glad to hear of any, though.

  • Error Message: "Can't Send Message using the Server UCPB GEN"

    Frequently i can't send emails from "UCPBGEN" "Gmail", "MSN" and "Yahoo". There are times i can, without changing any setting. The error message i am get is "Can't Send Message using the server..."
    When i check connection doctor, they are all green.

    What OS are you using?
    Double-checking all settings is good. Along the way, one thing to try:
    Have a look at your SMTP server settings to see if the port is set to "default" or "custom".  If it is "default" try switching to custom using one of the numbers listed under "default". That fixed it for me on one of my accounts.
    (To do all this:  Mail, Preferences, Accounts, Outgoing Mail Server, Edit SMTP server list, Advanced.)
    charlie

  • Intermittent "Cannnot send message using the server" error

    I've been getting an intermittent "Cannnot send message using the server" error for a couple of months now. It happens every 3 or 4 e-mails I try to send or reply to. I select "Try Again Later" and then open the message from the Outbox and resend with no problem.
    My setup is;
    Mail 2.1.1
    OSX 10.4.9
    MacBookPro
    CableVision is my provider
    It's a POP account
    My incoming server is pop.secureserver.net
    My outgoing server is smtpout.secureserver.net
    Server port 3535
    Authentication - Password
    SSL is off
    Any help would be appreciated

    Hi Dave, and a warm welcome to the forums!
    No expert on this, but I wonder since your using the secureserver, if SSL might not work better.
    Or maybe try...
    Incoming Mail Server Name (POP3): pop3.optonline.net
    Outgoing Mail server Name (SMTP): smtp.optonline.net
    or mail.optonline.com for both!?
    Nearly impossible to find any help on Cablevision's site.
    Also, I wonder if this might have something to do with Tiger's Mail also...
    http://discussions.apple.com/thread.jspa?threadID=1372763

  • How to send messages to the specified user through sap

    how to send messages to the specified user through sap

    Hi Santosh,
    try:
        CALL FUNCTION 'TH_POPUP'
             EXPORTING
                  CLIENT         = SY-MANDT
                  USER           = BNAME "User you want
                  MESSAGE        = MSG "text you want
             EXCEPTIONS
                  USER_NOT_FOUND = 1.
    Regards, Dieter

  • TS2755 cant send message when the 3G is on ?!

    cant send message when the 3G is on ?!
    unless i turn off the 3G the message wont be sent ,i called my service company for assitance , they sent to me an activation message for the SMS and asked me to reset the network settings , the problem still exits , i need you help please .

    (red exclamation mark ! ) not delivered , but i can recive sms and make calls normally , i just can't send sms unless i turn the 3G off  , everything was fine till 3 days ago this problem started to happen .

  • Error - cannot send message using the server....

    Until today I thought the following error message was due to a limitation imposed by my IP (Roadrunner). While talking with their Tech support on an unrelated matter I mentioned this error appears whenever I send an e-mail containing multiple groups (smart groups) created in Address Book.
    Roadrunner says the error is being triggered within Apple's Mail program and not at their server level. If that's true, then what is the recipient # ceiling within an e-mail (individual or group)? For further clarification, when the above error does appear (only occurs with 2 or more groups in the To: field, where recipients per list is over 50), the remedy is to remove all groups except one. Then the e-mail can be sent with no problem. If the multiple lists are below 50 or so, then the e-mail can be sent.
    Appreciate any feedback.

    Hi Ernie
    It might relate to how Mail lines up the addresses, but any limit is from the SMTP.
    RR Tech support said their system had a limit of 1,000 e-mails a day. Otherwise, all ought to go through. They suggested I call Apple (is that suggestion branded into their brains during their customer sensitivity training? )
    Are all the addresses in the To header, or elsewhere?
    All in the "To" field. As I posted, in Address Book the groups are created using Smart folders. On the receiver side, those that do go out reach the recipient with no problem.

Maybe you are looking for

  • Schedule view in Calendar

    Up to OS10.9, there is an option to show calendar events in a column, and event details in an adjacent column. Days without events were skipped. This was called "Schedule View". After upgrading to Yosemite, this option has disappeared. I find it very

  • UCCE 7.5.7 CAD macro to populate ICM Call Variable

    UCCE 7.5.7 CAD 7.5.8 I need to create a CAD Toolbar macro in Cisco Desktop Administrator that reads data from a text file (an 8 digit number) and writes this data to an ICM Call Variable. The 8 digit number is not known until after the call is answer

  • How do I get rid of annoying popups

    My husband uses the IPad to read and play card games. How do we get rid of those annoying pop up ads while he's playing cards.  Specifically Hearts and Solitaire.  Pop ups will appear when dealing another hand.  Sometimes the entire screen goes black

  • 55G310 Toshiba LCD TV Has no audio through HDMI 1 input

    I bought this TV last october new from Best Buy, and Have so far only had 1 HDMI device going in to the TV.  Today I went to plug in a second device, and I plugged it in through the HDMI 1 input.  I get picture, but no sound. I tried other hdmi cable

  • How stream detects -1

    import java.io.*; public class Fp5 public static void main(String[] args) throws IOException      try           int[] data = new int[10];           for (int i = 0; i < data.length; i++)                int datum = (byte)System.in.read();