ralph | 7 Jun 15:42 2016
Gravatar

background tasks in restlet

Hi,

I want to send an e-mail in response to a HTTP request by putting the e-mails to be send in a database backed queue and send them off one at a time by a background task. Is there a proper Restlet way to have a background thread which is woken up by a ServerResource ?

I figured I could try and use the TaskService for this but it seems Application#getTaskService() is deprecated. What is the recommended way of obtaining a TaskService or is there a better way to do this?

Thanks,
Ralph.

--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-discuss+unsubscribe <at> restlet.org.
Krishan Veer | 3 Jun 21:47 2016
Picon

turning off restlet

Experts,

We are using restlet in our application to support REST API. We want to implement Api on/off functionality. I'm curious if restlet framework can provide some way to toggle this?

Regards
Krishan

--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-discuss+unsubscribe <at> restlet.org.
xybrek | 25 May 08:23 2016
Picon
Gravatar

Timeout while writing to the queue-based output stream

I'm using Restlet version 2.3.5 for Google App Engine (GAE)

My GAE app breaks and RootServerResource stops working (serving) over 
time (1-2 hours usually) when this error hits:

     WARNING: Error while writing to the piped input stream.
     java.io.IOException: Timeout while writing to the queue-based 
output stream
               org.restlet.engine.io.PipeStream$2.write(PipeStream.java:99)
               java.io.OutputStream.write(OutputStream.java:116)
            com.dropbox.core.util.IOUtil.copyStreamToStream(IOUtil.java:52)

com.dropbox.core.util.IOUtil.copyStreamToStream(IOUtil.java:63)

com.dropbox.core.util.IOUtil.copyStreamToStream(IOUtil.java:34)

com.dropbox.core.v1.DbxClientV1$Downloader.copyBodyAndClose(DbxClientV1.java:535)
               com.dropbox.core.v1.DbxClientV1.getFile(DbxClientV1.java:427)

com.firststeps.resource.gae.GaeRootServerResource.getFile(GaeRootServerResource.java:268)

com.firststeps.resource.gae.GaeRootServerResource$1.write(GaeRootServerResource.java:140)
               org.restlet.engine.io.IoUtils$2.run(IoUtils.java:537)
               org.restlet.engine.Engine$1.run(Engine.java:158)

com.google.appengine.tools.development.RequestThreadFactory$1$1$2.run(RequestThreadFactory.java:110)
               java.security.AccessController.doPrivileged(Native Method)

com.google.appengine.tools.development.RequestThreadFactory$1$1.run(RequestThreadFactory.java:107)

The code that triggered this error is this (using [Dropbox SDK][1]):

     DbxRequestConfig config = new DbxRequestConfig("mydropboxapp/1.0", 
Locale.getDefault().toString(), AppengineHttpRequestor.Instance);
     DbxClientV1 client = new DbxClientV1(config, dropboxToken);
     DbxEntry.File md = client.getFile(path, null,  outputStream);

Where the HttpRequestor is [AppengineHttpRequestor][2].

 From my research this error is related to Restlet Framework bug, is 
there a way to fix this?

   [1]: https://github.com/dropbox/dropbox-sdk-java
   [2]: https://gist.github.com/anonymous/dc025b8ab2fed76659864d91d7236851

--

-- 
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-discuss+unsubscribe <at> restlet.org.

Jerome Louvel | 3 May 05:03 2016
Gravatar

Re: Is restlet swagger extension still working and maintained?

Hi Gabriele,

We are planning to upgrade/maintain this extension bit have limited bandwidth at this moment.

Ia this something you could help us accelerate with a contribution?

Best regards,
Jerome

On Apr 28, 2016 8:39 AM, "Gabriele Marsili" <g8marsili <at> gmail.com> wrote:
Hello everyone,

I was looking for a software that helps the documentation of an API and since the API uses the restlet framework I thought about using the extension for swagger.


I'm having many problems integrating the tags( <at> ) and since the last post regarding this extension dates from the beginning of 2015 I wanted to ask if you have any idea if the extension is still working and being maintained or if it's just deprecated.

Thank you in advance for your answers

--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-discuss+unsubscribe <at> restlet.org.
Gabriele Marsili | 28 Apr 17:39 2016
Picon

Is restlet swagger extension still working and maintained?

Hello everyone,

I was looking for a software that helps the documentation of an API and since the API uses the restlet framework I thought about using the extension for swagger.

https://restlet.com/technical-resources/restlet-framework/guide/2.3/extensions/swagger

I'm having many problems integrating the tags( <at> ) and since the last post regarding this extension dates from the beginning of 2015 I wanted to ask if you have any idea if the extension is still working and being maintained or if it's just deprecated.

Thank you in advance for your answers

--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-discuss+unsubscribe <at> restlet.org.
Christine Karman | 2 Mar 22:36 2016
Picon
Gravatar

SSL intermediate cert issue

I want to switch from using a self-signed certificate in Restlet, which 
worked well, to a startcom certificate. The reason I want to change it 
is that I want to give third parties access to the server without having 
to give them my self signed cert.

Now I see an issue with Restlet apparently not sending the certificate 
chain, which my android app doesn't like. When I type

openssl s_client -showcerts -connect pengo.christine.nl:9005

in a shell, I get this error:

CONNECTED(00000003)
depth=0 CN = pengo.christine.nl
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 CN = pengo.christine.nl
verify error:num=21:unable to verify the first certificate
verify return:1

When I type
openssl s_client -showcerts -connect pengo.christine.nl:9005 -CAfile 
./chain.crt

with chain.crt containing the root cert and intermediate cert, I get

CONNECTED(00000003)
depth=2 C = IL, O = StartCom Ltd., OU = Secure Digital Certificate 
Signing, CN = StartCom Certification Authority
verify return:1
depth=1 C = IL, O = StartCom Ltd., OU = StartCom Certification 
Authority, CN = StartCom Class 1 DV Server CA
verify return:1
depth=0 CN = pengo.christine.nl
verify return:1

My restlet configuration contains

         params.add("sslContextFactory", 
"org.restlet.engine.ssl.DefaultSslContextFactory");
         params.add("keystorePath", 
"/home/christine/motogymkhana/pengo_ssl.jks");
         params.add("keystorePassword", ServerConstants.keyStorePw);
         params.add("keystoreType", "JKS");
         params.add("keyAlias", ServerConstants.keyAlias);
         params.add("keyPassword", ServerConstants.keyPw);

The keystore does contain the same certificates as the chain.crt file.

How do I make Restlet send the chain with the certificate?

dagdag
Christine

--

-- 
dagdag is just a two character rotation of byebye

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3164075

ttemplier | 2 Mar 09:47 2016
Gravatar

Article "Optimizing your Restlet Framework server applications"

Hi all,

We just published an article about the way to optimize your server applications implemented with Restlet. We detailled the following:

- Using caching
- Compressing content
- Configuring specific converters
- Configuring template engines

You can reach this article at the following link: http://restlet.com/blog/2016/02/29/optimizing-your-restlet-framework-server-applications/

Thierry

--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-discuss+unsubscribe <at> restlet.org.
WayneP | 29 Feb 18:59 2016
Gravatar

404 returned for same URL

Hi,

something I'm seeing  is sometimes we get a 404 returned in production for a url that normally is fine. For example:

INFO: 2016-02-18        15:45:43        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-
443e-ad69-3c21c7143a92        -       200     0       965202  4347       Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:47 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:47        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-443e-ad69-3c21c7143a        -       200     0       940191  3640       Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:48 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:48        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-443e-ad69-3c21c7143a       -       200     0       11065   305         Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:48 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:48        195.2.244.193   -       127.0.0.1       443     POST    /api/newfolder/99471df9-79a4-443e-ad69-3c21c7143a     -       200     -       132     280         Restlet-Framework/2.1.6 -
Feb 18, 2016 3:45:51 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:51        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-443e-ad69-3c21c7143a       -       200     0       721892  2533        Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:54 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:54        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-443e-ad69-3c21c7143a        -       200     0       669242  2294       Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:54 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:54        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-443e-ad69-3c21c7143a        -       404     400     702546  3          Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:57 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:57        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-443e-ad69-3c21c7143a        -       404     400     620847  3        Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:59 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:59        195.2.244.193   -       127.0.0.1       443     POST    /api/newfolder/99471df9-79a4-443e-ad69-3c21c7143a    -       404     400     120     4        Restlet-Framework/2.1.6 -



Why would restlet return a 404 when normally it should process the request and return 200?

thanks

--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-discuss+unsubscribe <at> restlet.org.
WayneP | 29 Feb 18:53 2016
Gravatar

404 returned for same URL

Hi,

something I'm seeing in production is sometimes we get a 404 returned for a url that normally is fine. For example:

INFO: 2016-02-18        15:45:43        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-443e-ad69-3c21c7143a92        -       200     0       965202  4347       Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:47 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:47        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-443e-ad69-3c21c7143a92        -       200     0       940191  3640       Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:48 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:48        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-443e-ad69-3c21c7143a92        -       200     0       11065   305         Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:48 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:48        195.2.244.193   -       127.0.0.1       443     POST    /api/newfolder/99471df9-79a4-443e-ad69-3c21c7143a92     -       200     -       132     280         Restlet-Framework/2.1.6 -
Feb 18, 2016 3:45:51 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:51        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-443e-ad69-3c21c7143a92        -       200     0       721892  2533        Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:54 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:54        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-443e-ad69-3c21c7143a92        -       200     0       669242  2294       Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:54 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:54        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-443e-ad69-3c21c7143a92        -       404     400     702546  3          Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:57 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:57        135.196.39.58   -       127.0.0.1       443     POST    /api/upload/99471df9-79a4-443e-ad69-3c21c7143a92        -       404     400     620847  3        Apache-HttpClient/4.3.1 (java 1.5)      -
Feb 18, 2016 3:45:59 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2016-02-18        15:45:59        195.2.244.193   -       127.0.0.1       443     POST    /api/newfolder/99471df9-79a4-443e-ad69-3c21c7143a92     -       404     400     120     4       https://admin.glasscubes.com    Restlet-Framework/2.1.6 -



Why would restlet return a 404 when normally it should process the request and return 200?

thanks

--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-discuss+unsubscribe <at> restlet.org.
Binoy Dalal | 13 Feb 22:04 2016
Picon

Document is empty error while returning get response in Chrome

Hello everyone,
I've just started out with the restlet framework.
I've written simple server and resource classes to get started. Here's the
code:
Resource:
/import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;

public class HelloWorldResource extends ServerResource {
	 <at> Get
	public String represent(){
		return "Hello World";
	}
}/

Server:
/import org.restlet.Server;
import org.restlet.data.Protocol;

public class HelloWorldServer {
	public static void main(String[] args) throws Exception {
		Server server = new Server(Protocol.HTTP, 8989, HelloWorldResource.class);
		server.start();
	}
}
/

When I try to run the code in Chrome by hitting /http://localhost:8989// I
get the following error:

<http://restlet-discuss.1400322.n2.nabble.com/file/n7579436/Capture.png> 

This error goes away when I enclose the resource return value in xml tags
like so /<sometag>Hello World</sometag>/ and the default XML template is
displayed in Chrome with "Hello World" in the tags.

Using a /ClientResource/ variable to access the resource via code works just
fine without the tags.

Additionally, while running the same code in IE, it automatically downloads
a JSON file with the message to my computer.

What is the reason behind this kind of behavior?

Thanks.

--
View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Document-is-empty-error-while-returning-get-response-in-Chrome-tp7579436.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3160391

Nick Ver Voort | 8 Feb 19:11 2016
Picon
Gravatar

Restlet with logback-access?

Hi, I'm trying to integrate logback-access into my webapp, which is Reslet with an embedded Jetty server. I already have logback-classic working, via the restlet slf4j bridge, but access seems to be a whole other beast. Has anybody done this before? Thanks!

--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-discuss+unsubscribe <at> restlet.org.

Gmane