Calling 15 Web services sequentially [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Scenario is that there are 15 web services which I need to invoke to invoke and the consolidated response needs to be send to another system .My query is these 15 services need to invoked for around 1000 requests(because there are 1000 sales people whose data is fetched from these 15 web services). What would be efficient implementation of this . If I create several threads for different sales people then might the services which I am invoking are not thread safe . So should i call the services sequentially ? But that would degrade the performance .

Web services, by their nature, are meant to handle concurrent requests. You only need to worry about thread safety within your client application and can safely assume the web services you are calling are thread safe.

Related

Design patterns for pre initialize data for one task [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I have working on developing scheduling application as a start up and application take some time to complete. during the scheduling process I cannot use service calls to load data, because it will reduce the performance. It may cause to terminate the process if data access failed.
So I need to load required data before starting the scheduling process and discard that data after completing the schedule. This is some kind of caching but it doesn't need all the features in caching like check for expiries, discard expiries update new changes etc. Need to load once a month only for the scheduling.
So can somebody tell me what is the best design pattern to handle that situation. Thanks
Well that's a place for Prototype pattern, but you should also consider using some caching framework and just disable all fancy features like expiration, pinning, etc.
In the test automation patterns such
need to load required data before starting the scheduling process and discard that data after completing the schedule.
is called fixtures. So what you need can be achieved with setUp() and tearDown() functionality. Generally a Setup Decorator will do just fine. It'll "bracket" the execution of the entire scheduling process with a set of matching setUp and tearDown "book ends".

Cross-platform notification service [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I would like to develop an application using push notification service (like Whatsapp). What kind of service would I have to use to manage all kinds of operating system?
I would suggest using a backend like Parse.
http://www.parse.com
It's a good starting place and supports all different types of OS's.
It stores data, provides analytical stats and also allows you to send push notifications to 1 million unique devices - without paying a penny.
Hope this helps.
Cheers
Ryann

Server to Server communication using servlet? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
In my case there is a cloud server and personal application server.
I have to make a communication between both servers for accessing the data periodically.
How to create api for communication using servlet.
Is possible to use timer in servlet?
Any other suggestions?
Thanks in advance.
Yes, you can user a timer within a servlet, but as Stanley suggested, web services is a layer on top of http that you can use and it may be easier.
If you just need some quick and dirty way, you can write a servlet to receive the http request in one end and some http client to do the request.
If you go Java EE, it's even easier because you can generate web services using annotations and there's already a TimerService so you won't have to reinvent the wheel.

Concurrency in java web application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I read lot of blogs and articles that ask to take care while coding for synchronization. They ask to use concurrentHashMap, synchronizedList etc.
As per my understanding, in java web application, Application server (e.g. jboss, weblogic, tomcat), every request run under a separate thread.
e.g. I have sequence of method execution method1--> method2--> method3, then every request will have its own execution stack. Then why do we need to think more about synchronization?
Either my understanding about concurrent request is not correct or I am missing something about synchronization scenarios.
Please advise.
Because in most applications, processing a request involves accessing some shared data that may also be accessed by other threads handling other requests at the same time.
HTTP sessions are a prime example: all requests in the same session share the same HttpSession object, so if a browser sends two requests at the same time, the two threads handling those requests may try to access the same HttpSession object at the same time. You need synchronization to avoid corrupting the session.

Using JNI in JSP page? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
how to use JNI in JSP page?.In net i found that
1. because if anything goes seriously wrong in the C part of your application, it will very likely crash your J2EE server, downing all other web services and applications it is running.
because the 'reactivatable' nature of web applications means there is no guarantee that a static initializer will not be executed more than once during one JVM run.
Unless you're confident of the reliability of your JNI-linked library, I'd strongly recommend not doing this, for the reasons you've identified.
I'd recommend decoupling the application server from your native code, and make the native library available via some remote mechanism (e.g. web service / REST / simple socket). That way you've isolated the app server from any fatal problems related to the native code.

Categories

Resources