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

  • Home
  • SEARCH
  • 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 7278703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:54:39+00:00 2026-05-28T22:54:39+00:00

I have a single threaded message listener that listens for the incoming messages.The received

  • 0

I have a single threaded message listener that listens for the incoming messages.The received messages are persisted in a database as they are recieved.

There is a message A and associated message B follows it with a reference it.In Some Odd occurences, B arrives before A. Now in this case, There has to be 3retries after some ‘x’ equal intervals to see if A has arrived and then persists the association.

As the message listener is single threaded if we put the thread to sleep the whole system would be affected. So there has to be a separate thread retrying.

Can we use Quartz Job Scheduler for this purpose to avoid handling multiThreading issues and to have a PERSISTENT STORE of the in any of the following 2 ways,

  1. Schedule a Job in Quartz for 3 times and keep track of a flag in the JobDataMap to check if previous retries succeeds then return without doing anything

OR

2.Schedule a Job to retry once and then if the retry fails schedule the same job after a few seconds.

Can quartz be used only for repetitive jobs and not have some state information span across job or Is there any other better way to do this.

  • 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-28T22:54:39+00:00Added an answer on May 28, 2026 at 10:54 pm

    You should configure your JMS provider to set the redelivery delay on your message queue. In your code, you call context.setRollbackOnly to abort a message that does not pass prerequisites check.

    In that case, the code execution scenario becomes:

    • consume “B”, check for prerequisite and detect A is lacking
    • roll back the transaction and the message returns to the queue, it will be re-delivered after the configured delay
    • consume and process next message “A”
    • after the delay, the MDB consumes and processes again “B” with success
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a single-threaded application that uses 3 SQLite databases in 3 different files
When I run a single-threaded program that i have written on my quad core
we have a single threaded application that simulates the interaction of a hundred of
I have a single threaded C# assembly (my client) that subscribes to multiple events
I have a thread that creates COM objects that require a single threaded apartment.
I have an single threaded, embedded application that allocates and deallocates lots and lots
I have a simple single threaded Clojure program that creates a temp file for
Possible Duplicate: Are C# arrays thread safe? I have a program that is single-threaded
I have a single-threaded Rails app running on thin in single-threaded mode on Heroku
I'm at the end of my rope here: I have a single-threaded C++ program.

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.