How configure timeout for apache camel jetty component - apache-camel

I use Talend Open Studio 5.6 ESB, I make a apache camel route. The end of my route is :
.removeHeaders("CamelHttpPath")
.removeHeaders("CamelHttpUrl")
.removeHeaders("CamelServletContextPath")
.to("jetty:http://toOverRide?bridgeEndpoint=false&throwExceptionOnFailure=false&useContinuation=false&httpClient.timeout=120000&httpClient.idleTimeout=120000")
Before this, I overide the url in the jetty component for call a remote service. This service takes 30 seconds to reply, the route closes the connection and send a error 503. How can I increase the timeout.
log camel :
[WARN ]: org.apache.camel.component.jetty.CamelContinuationServlet - Continuation expired of exchangeId: ID-A1995-62398-1480423883621-0-1
[WARN ]: org.apache.camel.component.jetty.CamelContinuationServlet - Cannot resume expired continuation of exchangeId: ID-A1995-62398-1480423883621-0-1
reponse :
HTTP/1.1 503 Service Unavailable
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 1325
Server: Jetty(8.y.z-SNAPSHOT)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 503 Service Unavailable</title>
</head>
<body>
<h2>HTTP ERROR: 503</h2>
<p>Problem accessing /sync/mockTmcWithLog/utilisateurs/30000. Reason:
<pre> Service Unavailable</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>

Here is an example:
.to("jetty:http://toOverRide?continuationTimeout=900000&httpClient.timeout=900000")

Related

Solarium return Solr HTTP error : OK (404)

I use Solarium to access Solr with Symfony. It works without problem on my computer and dev computer but not on prod server.
On the prod server, Sorl is running with the same configuration, same port, same logins.
Do you have any idea of what can be the problem?
Here is the error
Solr HTTP error: OK (404)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Not Found</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Not Found</h2>
<hr><p>HTTP Error 404. The requested resource is not found.</p>
</BODY></HTML>
Problem solved. There was a wrong proxy installed on the windows server.

Google App Engine 500 internal server error on post requests

I'm create Google App Engine instance with code based on vertx and try to habdle post requests.
If i launch my application locally - everything work ok, but if i try to POST request to installed app engine host - all my requests ends with 500 internal server error.
Why? Maybe i forget something?
For example:
curl -w "%{http_code}" -d "url=test" -X POST "http://localhost:80/hashposttest"
Use url: http://nifty-memory-w307.appspot.com/hashget/200okkk#Sprite:~$
curl -w "%{http_code}" -d "url=test" -X POST "https://nifty-memory-268407.appspot.com/hashposttest"
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>500 Server Error</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered an error and could not complete your request.<p>Please try again in 30 seconds.</h2>
<h2></h2>
</body></html>
500

HTTP ERROR 401 and 404 while running Solr search

I am working on a hybris upgrade to 1808 version. To do this upgrade, i have to upgrade Solr to version 7.4. The upgraded solr server is getting started without any error but when i try to search for any product, it throws HTTP ERROR 401
[m de.hybris.platform.solrfacetsearch.search.FacetSearchException: Error from server at https://localhost:8983/solr: Error from server at https://localhost:8983/solr/master_XXXXXXX_Index: Expected mime type application/octet-stream but got text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 401 require authentication</title>
</head>
<body><h2>HTTP ERROR 401</h2>
<p>Problem accessing /solr/master_XXXXXXXX_Index/select. Reason:
<pre> require authentication</pre></p>
</body>
</html>
at de.hybris.platform.solrfacetsearch.search.impl.LegacyFacetSearchStrategy.search(LegacyFacetSearchStrategy.java:204) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.search.impl.DefaultFacetSearchService.search(DefaultFacetSearchService.java:89) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.search.impl.DefaultFacetSearchService.search(DefaultFacetSearchService.java:78) ~[solrfacetsearchserver.jar:?]
at com.hybris.XXXXXX.core.search.content.impl.XXXXXXXXSearchService.quickSearchContent(XXXXXXXXSearchService.java:754) [classes/:?]
As i know that this version of solr is using https and security.json for authentication and authorizations, so i removed all authentication related settings i.e. security.json, properties file entry for authType, users and passwords.
[m de.hybris.platform.solrfacetsearch.search.FacetSearchException: Error from server at https://localhost:8983/solr: Error from server at https://localhost:8983/solr/master_XXXXXXXContent_Index: Expected mime type application/octet-stream but got text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/master_XXXXXXXContent_Index/select. Reason:
<pre> Not Found</pre></p>
</body>
</html>
at de.hybris.platform.solrfacetsearch.search.impl.LegacyFacetSearchStrategy.search(LegacyFacetSearchStrategy.java:204) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.search.impl.DefaultFacetSearchService.search(DefaultFacetSearchService.java:89) ~[solrfacetsearchserver.jar:?]
at de.hybris.platform.solrfacetsearch.search.impl.DefaultFacetSearchService.search(DefaultFacetSearchService.java:78) ~[solrfacetsearchserver.jar:?]
at com.hybris.doterra.core.search.content.impl.XXXXXXXXContentSearchService.quickSearchContent(DefaultDoterraContentSearchService.java:754) [classes/:?]
I am not sure about what configurations / steps missing which is causing this issue.

why nutch index to a wrong solr collection even though set solr.server.url parameter?

integrate nutch 1.15 with solr8.0, but when i use the following command
nutch/bin/crawl -i -D solr.server.url=http://192.168.199.109:8983/solr/csdn -s ./csdn-seed/ ./data/csdn 1
to index crawled data from nutch to solr it throw out the exception in hadoop.log
2019-03-23 02:03:07,491 WARN mapred.LocalJobRunner - job_local1877827743_0001
java.lang.Exception: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr/nutch: Expected mime type application/octet-stream but got text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/nutch/update. Reason:
<pre> Not Found</pre></p>
</body>
</html>
at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:529)
Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr/nutch: Expected mime type application/octet-stream but got text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/nutch/update. Reason:
<pre> Not Found</pre></p>
</body>
</html>
but actually, i set solr.server.url to /solr/csdn isn't it? but why it told me that it is indexing to /solr/nutch?
The way indexer plugins are configured has changed with Nutch 1.15: all indexer plugins are now configured in a single XML file (conf/index-writers.xml), setting or overwriting configuration parameters via Nutch properties is not possible anymore.
See https://wiki.apache.org/nutch/IndexWriters how to configure the Solr server URL. This breaking change was necessary to allow multiple indexers of the same type, e.g. multiple Solr instances.

SIM7000E - HTTP POST with AT Commands

I am using a SIM7000E module to which I send AT commands over UART. I configure the module sending the following set of commands:
AT+CPIN=1234
AT+CREG=1
AT+CGATT=1
AT+CIPSTATUS
AT+CIPMUX=0
AT+CSTT="vpn","user","password"
AT+CIICR
AT+CIFSR
AT+CIPSTART="TCP","xxx.xxx.xxx.xxx","80"
Everything works fine until this point.
However, I want to register a variable using POST method :
AT+CIPSEND
> POST /register.node#1 HTTP/1.1
Host: xxx.xxx.xxx.xxx
Content-Type: application/x-www-form-urlencoded
cache-control: no-cache
Postman-Token: be423989-072e-4262-857a-f985157ec720
(Empty line)
(Ctrl+z)
The command in C is:
"POST /register.node#1 HTTP/1.1\r\nHost: xxx.xxx.xxx.xxx\r\nContent-Type: application/x-www-form-urlencoded\r\ncache-control: no-cache\r\nPostman-Token: be423989-072e-4262-857a-f985157ec720\r\n\r\n"
And the response I get is:
SEND OK
HTTP/1.1 400 Bad Request
Date: Wed, 21 Nov 2018 21:54:00 GMT
Server: Apache/2.4.25 (Debian)
Content-Length: 295
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>400 Bad Request</title>
</head>
<body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br/>
</p>
<hr>
<address>Apache/2.4.25 (Debian) Server at ::1 Port 80</address>
</body>
</html>
CLOSED
I do not know what is wrong with the code. I downloaded Postman app, made the same POST and it works as expected:
You might try the AT+HTTPPARA command. You can give it the url with this command and also specify USERDATA for posting using these commands, as well as other request headers.
AT+HTTPPARA="URL","website.com"
AT+HTTPPARA="USERDATA","KEY=VALUE&KEY=VALUE"
AT+HTTPACTION=2 #this says submit as a POST request
AT+HTTPREAD #returns the reply from the server

Resources