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 8052455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:33:02+00:00 2026-06-05T07:33:02+00:00

is there a way to pass a BlockingQueue to a job in the Quartz

  • 0

is there a way to pass a BlockingQueue to a job in the Quartz framework? I tried to use the JobDataMap for passing the BlockingQueue but that doesn’t seem to work. Here the relevant code fragment:

JobDetail job = newJob(Jobby.class)
  .withIdentity("myJob", "group1")
  .usingJobData("buffer", queue)
  .build();

Perhaps someone has an idea on how to achieve 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-06-05T07:33:02+00:00Added an answer on June 5, 2026 at 7:33 am

    Looks like you are trying to implement producer/consumer design pattern where producers are placing work in a queue and consumer checks that queue periodically using Quartz. This design isn’t bad, however your implementation won’t work. By passing that queue to the job data Quartz will serialize it and deserialize it back when jobs trigger. The queue won’t be passed by reference but by value (copy). This is understandable if you realize that Quartz should work in a distributed environment, where job is scheduled and persisted to the database on one node and deserialized and executed on other node.

    That being said you need to reevaluate your implementation. If you don’t care about clustering and distribution, make your queue somehow globally available. Your options are:

    • global singleton – please, no
    • resource available via jndi
    • spring bean injected to both producers and job class (Spring supports Quartz quite well)
    • …

    I specifically recommend using spring, jndi is also a nice option. But if we are talking about jndi – why not consider using some lightweight jms implementation instead of Quartz? You would avoid latency.

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

Sidebar

Related Questions

Is there a way to pass parameters to a resource dictionary? I think that
Is there a way to pass some extra parameter to the function that is
is there a way to pass an array to a member function? i tried
Is there a way to pass the IObjectFactory or the ApplicationContext that is currently
Is there a way to pass through a variable to Kohana messages, which can
Is there a way to pass a method as a parameter without knowing anything
Is there a way to pass a string argument to a process which is
Is there a way to pass a HashTable loaded with key/values to a page
Is there any way to pass HTTP AUTH username and password along with an
Is there any way to pass command line parameters to a Flash projector in

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.