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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:43:09+00:00 2026-05-24T05:43:09+00:00

I am having a design issue here. I have a RESTful web service implemented

  • 0

I am having a design issue here. I have a RESTful web service implemented with jersey. I am also using spring mail to send email.

My specification needs to notify a certain group of users (15-20 approx.) that a PUT request has been made and inform them with the modification of a resource. Also I need to send a JSON array to the client who made the request as a response.

Right now what I have done is after the modification in my method where I process the PUT service,I send emails to the users and then I return the JSON status.

But why should the client wait for the mail notification to finish?What if my suer list is long and clients wait a long time to get a response. It is not his headache. But also I need to notify users too within the PUT method. If I return JSON I lost the context to send notification by getting out from the request response cycle.

Is there a better way to do that?

To have an idea,I am providing the relevant part of my code:

 //first notify users
 notifyUsers(event,jsonEntity,NotificationType.TicketType.UPDATED);

 //then return response  
 return new JSONObject()
            .put("response_code:", Response.status(Status.OK).build())
            .put("title", evento.getDescrizioneevento())
            .put("status", getEventAsString(evento.getStatoevento()))
            .put("solved", evento.getCausascatenante());
  • 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-24T05:43:10+00:00Added an answer on May 24, 2026 at 5:43 am

    Make “notifyUsers” asynchronous.

    Queue up the request, and process it later. You can use a simple BlockingQueue in a singleton with a thread listening to the other end, or you can set up a more formal queuing system such as JMS. You could also insert the request in to a database and have something listening for activity there.

    Or you could simply fire up a simple thread right there, and let it run as you return from the request. That can work too.

    All sorts of alternatives with different pros and cons.

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

Sidebar

Related Questions

I am having trouble deciding between two possible design choices. I have a web
Hi I have come up with a small design but im having one issue
There is a big design flaw here, but I'm having trouble solving it: The
what basic tips should we observe in design web pages(html/css/javascript) for having highest compatibility
I am having some troubles thinking through a design issue and thought that the
Hi, i have been having some problems using JSON data in flash builder lately
We have a web application that runs on IIS using .NET 2.0 developed and
I'm having a hard time making a design decision I have a class in
I'm having a UI design issue, this is what I want the contents of
I have been having an issue with Visual Studio 2010 that is driving me

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.