Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6606455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:23:52+00:00 2026-05-25T19:23:52+00:00

I am fairly new to Java EE and JMS and am looking at doing

  • 0

I am fairly new to Java EE and JMS and am looking at doing an implementation using JMS.

Think of the following scenario:

Scenario

A user hits a servlet. A message is then put into a JMS server/Queue from this servlet. A response is then sent back to the user saying “Message Queued”.

Option 1

The consumer/MDB receives the message from the JMS queue and processes it. This is normal operation and pretty standard.

Option 2

There is no consumer(for what ever reason) or the receiver is processing messages too slow. So what I would like is for the message in the queue to timeout. Once timed out, and email should be sent etc (email is just as an example).

Reading the API spec/Java EE 6 tutorial I have found in the QueuSender class

void send(Message message, int deliveryMode, int priority, long timeToLive) 

So by settings the timeToLive the message will be evicted from the queue. The problem is that the is no “interface/call back” to know that the message was evicted. It just disappears. Or am I mistaken?

Another approach I thought of was for a thread to monitor the queue and evict messages that are “expired” and pull them from the queue. But I don’t think that is possible, is it?

Any light shed on this matter would greatly be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:23:52+00:00Added an answer on May 25, 2026 at 7:23 pm

    You have to make use of some implementation specific functionality to fulfill your requirements. The JMS specification does neither define which action is taken with a timed out message, nor does it offer you any reasonable criteria selection when polling messages from a queue.

    Most (if not all) JMS implementations do however offer the concept of DLQs (dead letter queues). If a message cannot be delivered to a regular consumer or times out, the JMS implementation will most likely be able to move the message to a DLQ, which is basically also a regular queue with its own listener.

    So, if you set up two queues, Q1 and Q2 and configure Q2 as a DLQ for Q1, you would do your normal request processing in a listener on Q1 and implement an additional listener for Q2 to do the error/timeout handling.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Another question about my implementation. I am fairly new to java/android coming from a
I'm fairly new to java and looking for an interface that simply guarantees that
I am fairly new to Java programming and was following a tutorial located here:
My background is .net, I'm fairly new to Java. I'm doing some work for
Im fairly new to Java and im just looking for a little help Im
I am still fairly new to Java programming and I was looking over a
I'm fairly new to Java (been writing other stuff for many years) and unless
I'm fairly new to Java and am writing an app that needs an XML
I'm fairly new to programming and new to java, but I'd like to jump
I am new to IntelliJ (and Stackoverflow) and fairly new to Java,In my application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.