Is restlet + simple combination suitable for production environment? - restlet

I have a processing application which accepts REST requests and doesn't include a GUI such as a web front-end. Processing is light but the number of requests is quite high (more than 10,000 requests in a second).
I wonder if Restlet + Simple combination is appropriate for this scenario or do I have to use a Java EE edition?
Does anyone have experience with Restlet + Simple combination?

In Restlet, you have the concept of server connectors. This means that you could choose the appropriate connector for your need in a JSE environment (edition jse). It's clear that the default connector isn't suitable for production (it was even not present within org.restlet in the last version 2.3). So you can choose to use the Jetty extension (simply put the extension org.restlet.ext.jetty in your classpath - no impact in your application code) to use it as transport. We use successfully this approach in production (with load balancy in front of this) for one of our application.
If you don't want to handle load balancing, ... by yourself, you could prefer to use an application server to let it handle this.
Hope it helps you,
Thierry

Related

Webapp start and stop listener using jax-rs

I am using jax-rs for restful service. And I am trying to find out how I can use a contextlistener for webapp ? I am specifically using jax-rs 2.0 . Any suggestions on how to go about it , would be helpful. Thank you.
I'm not sure what linkage problem you have with servlet.jar. It should actually be in your classpath already, since JAX-RS uses it, too.
Also, if you use a framework such as Hibernate (or another JPA implementation for your MySQL database access), you may want to rely on the events that they trigger after insert/update/delete operations: see https://docs.jboss.org/hibernate/orm/4.0/manual/en-US/html/events.html for example.
Just my 2c.

How can I start a process using activiti-restapi and soapui or restclient

I want to start a simple process that can be in activiti-explorer or I deployed,using activiti-rest api. I use SoapUI or RESTClient.Actually I wrote URL and I can see all of the process,after I start the process with rest-services, I can see the process started in SoapUI,becasuse the reponse is true,but in activiti-explorer,process isn t starting.What should I do? I m waiting your helps
Thanks
My guess is that you deployed the activiti-webapp-explorer2 and activiti-webapp-rest as separate war files and each is using an in memory database.
This means, the applications are essentially seperate.
You have two choices.
Deploy as separate webapps but set them to use the same database instance/
Merge the rest API jar into the explorer webapp.
Both methods are acceptable.

Re-route/Divert some WL.Client Adapter Invocation traffic to WL Server through different URL (for PCI payment and security requirements)?

Worklight 5.0.6.1
We are having a specific requirement from our client about using a PCI Appliance from Intel (http://info.intel.com/rs/intel/images/Intel_Expressway_Tokenization_Broker.pdf) to avoid a PCI Audit for the application and server.
Therefore, the Adapter calls that have something to do with payment data would need to go through this hardware appliance before hitting the worklight server. All other adapter calls should go to the worklight server directly (to not overload the appliance).
The idea is to have two different URLs but the same worklight server in the background. It is assumed that the calls through the appliance will be transparent for the worklight server, so worklight functionality should not be impacted.
My questions around this would be:
a Worklight best-practice for having two different URLs for the same worklight server and alternating those URLs from the client for Adapter invocations (only; not direct update or anything else, since we assume this is executed native)?
is it possible to dynamically overwrite the worklight server URL that is used for an adapter invocation through JavaScript code in the client code? e.g. overwrite a specific JS function that gets/returns the worklight URL from somewhere before the WL.Client AJAX adapter invocation?
We are also looking into having a load-balancer switch the route based on a regex of the AdapterName that is being invoked or so. But it is not sure right now if that is possible and what the performance impact is.
Though possible, this is not something supported by WL. You will not be able to get help from support in case something goes wrong (and it will). You have to keep in mind that all server cookies (e.g. session id) are per domain. Therefore when you're dynamically changing server URL you will loose them. Therefore WL server will treat your request as a new session, unrelated to an old (existing) one. This is not something specific to WL, this is how HTTP works.
WL keeps server URLs in two global properties - WL.AppProp.WORKLIGHT_ROOT_URL and WL.AppProp.APP_SERVICES_URL. You can override them thus changing server URLs.
First one is used for all requests triggered by developer (init, connect, login etc). Second one is used for miscellaneous internal functionality (e.g. encrypted cache).
Once again - this is a hack, definitely not a solution. Use with caution if at all:)
How About this,if we define our own function that will call some static properties and update them ?
function changeServerUrl(serverURL) {
WL.StaticAppProps.APP_SERVICES_URL = serverURL + WL.StaticAppProps.POSTFIX_APP_SERVICES_URL;
WL.StaticAppProps.WORKLIGHT_ROOT_URL = serverURL + WL.StaticAppProps.POSTFIX_WORKLIGHT_ROOT_URL;
WL.StaticAppProps.WORKLIGHT_BASE_URL = serverURL;
}
and call it
chnageServerUrl("http://"+yourServerIP+":"+PORT);
if you dig into the worklight.js file there is a function "setWLUrl(url)" that can be use to change the serevr URL.
call it like this and its done
setWLUrl("http://"+yourServerIP+":PORT");
its kind a hack but i think it should not have anny issue since its a function within there api.
Good Luck

Session Expiration Handling in Apache Click (Clickide-2.3.0.)

I am a newbie to Apache Click Framework and I have been evaluating Clickide-2.3.0.0 over the past few days. I am stuck on one part involving session timeouts.
If I want to handle session expiry by setting session timeout interval in my server configuration (I am using Apache Tomcat 7), there is no support provided by Click as provided in case of other Frameworks like ZK (timeout-uri specified in .zul file)
All the work-arounds that I have found so far involve hard coding the validation and constraint checks explicitly in Java using session objects or context manipulation. No support available from Framework side.
It Page or Control has a Context object. The Apache Click docs has some examples about it.

flex 3 and acessing remote java objects

im just starting to learn flex and im trying to understand how Flex does remoting? From what i have read it looks like Flex provides a LifeCycle data services war which sits on your server and intercepts your remote calls , is this close?
Im concerned that if i use this option that 1. Ill have to add an extra war to my server - the lifecycle data service war and 2. That i will have to pay for a license for each instance i use on each cpu.
Is there an easier [free] option out there which i can use to call my remote java objects from within my flex mxml?
Blaze DS is based off the same APIs / code base as LiveCycle Data Services and is completely free and open source:
http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/
There are a number of other options available including:
Granite DS
WebOrb
FluorineFX (for .NET)
There are also solutions for PHP, Python and Ruby, although I can't recall their names right now.
Easiest option is to send xml from the server and to use it in Flex.
However if you want to use java Objects you can go for BlazeDs. It would require you to put an extra jar files (an no incensing) Also there are other options available as WebOrb for java nr meraapi.