0

I have deployed on SMX the following route that proxies all ReST request to the real ReST service provider (Tomcat). All ReST calls to SMX routed successfully however a saveDocument service that uploads PDF files fail.

public void configure() throws Exception {
from("jetty:http://{{smx.host}}:{{smx.rest-proxy-port}}/{{smx.context}}matchOnUriPrefix=true")
.log("ReST call received (Java DSL)")
.to("jetty:http://{{real-server-address}}:{{real-ws-port}}/{{context}}?bridgeEndpoint=true&throwExceptionOnFailure=false")
.log("Rest call proxied (Java DSL)");
}

The following exception is logged in servicemix.log.

19:53:57,065 | WARN | HttpClient-137 | HttpExchange | 111 - org.eclipse.jetty.util - 7.5.4.v20111024 | EXCEPTION JettyContentExchange@188af650=POST//real-server-address...:8080/contextpath.../saveDocument#SENDING(3ms)-> EXCEPTED(0ms)sent=3ms java.lang.IndexOutOfBoundsException

Do I have to perform some additional processing on the base64 before redirect the call to the real ReST service?

UPDATE on my previous post. This seems to work when I use txt file but fails for pdf or doc.

UPDATE 2: It also fails when txt size exceeds 7KB.

Is it possible to set camel jetty to accept big size files?

рüффп
  • 5,172
  • 34
  • 67
  • 113
Nikos Berdos
  • 161
  • 7

1 Answers1

0

This can be solved if Multipart WS is used. I have implemented a Multipart CXF ReST file upload service for testing the route in case of a multipart WS.

The following route works OK for multipart:
from("jetty:http://.../?matchOnUriPrefix=true&enableMultipartFilter=false")
        .noStreamCaching()
        .log("Service Proxied")
        .to("jetty:http://...:../?bridgeEndpoint=true&throwExceptionOnFailure=false");

Still cannot find what is going wrong with the first WS.

The issue is tracked here also.

Nikos Berdos
  • 161
  • 7