You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by anand_tech <an...@gmail.com> on 2013/05/28 08:01:14 UTC
Using jetty component for http producer : Weird behavior
Hi,
I have a route like this in Java DSL
from("servlet://abc/?matchOnUriPrefix=true")
.process(new Processor()
{
@Override
public void process(Exchange arg0) throws Exception
{
Message inMessage = arg0.getIn();
String query = inMessage.getHeader(Exchange.HTTP_QUERY, String.class);
query+="&key="+"encrypted";
query+="&client="+"blahblah";
inMessage.setHeader(Exchange.HTTP_QUERY, query);
}
})
.to(ExchangePattern.InOut,
"jetty://https://maps.googleapis.com/maps/api/place/photo?bridgeEndpoint=true&throwExceptionOnFailure=false&chunked=false")
The problem is that when jetty component sends http request it skips ":"
character after https. Here are my logs:
[2013-05-27 16:17:45,591] org.apache.camel.component.jetty.JettyHttpProducer
DEBUG - Starting producer:
Producer[https://maps.googleapis.com/maps/api/place/photo?bridgeEndpoint=true&throwExceptionOnFailure=false]
[2013-05-27 16:17:45,592] org.apache.camel.impl.ProducerCache DEBUG - Adding
to producer cache with key:
Endpoint[https://maps.googleapis.com/maps/api/place/photo?bridgeEndpoint=true&throwExceptionOnFailure=false]
for producer:
Producer[https://maps.googleapis.com/maps/api/place/photo?bridgeEndpoint=true&throwExceptionOnFailure=false]
[2013-05-27 16:17:45,593] org.apache.camel.processor.SendProcessor DEBUG -
>>>>
Endpoint[https://maps.googleapis.com/maps/api/place/photo?bridgeEndpoint=true&throwExceptionOnFailure=false]
Exchange[Message: [Body is null]]
[2013-05-27 16:17:45,599] org.apache.camel.component.jetty.JettyHttpProducer
DEBUG - *Sending HTTP request to:
https//maps.googleapis.com:443/maps/api/place/photo?chunked=false&maxwidth=80&photoreference=CnRwAAAAw2ZAy_2j-1qX0acePL_UPebtDtA7O6fFFsjX6tWn0gTWy_iKos50DnznRrjSuZeW90iYcyWYNLwnvpUAVWrdiGYL5HDPKODUFNvmR6jY9lMBRhtXSeTOGRnS3TIOqWDw3uw94gmCcPG-7iyMiPvHtRIQzOy5YEYPCjRjbjDXzCiTLRoUMG3S9rfMT-J0er4bLon_rSqQ_WQ&sensor=true&key=encrypted&client=blahblah*
[2013-05-27 16:17:45,750]
org.apache.camel.component.jetty.JettyContentExchange DEBUG - TaskComplete
with state 7 for url:
https//maps.googleapis.com:443/maps/api/place/photo?chunked=false&maxwidth=80&photoreference=CnRwAAAAw2ZAy_2j-1qX0acePL_UPebtDtA7O6fFFsjX6tWn0gTWy_iKos50DnznRrjSuZeW90iYcyWYNLwnvpUAVWrdiGYL5HDPKODUFNvmR6jY9lMBRhtXSeTOGRnS3TIOqWDw3uw94gmCcPG-7iyMiPvHtRIQzOy5YEYPCjRjbjDXzCiTLRoUMG3S9rfMT-J0er4bLon_rSqQ_WQ&sensor=true&key=encrypted&client=blahblah
[2013-05-27 16:17:45,750]
org.apache.camel.component.jetty.DefaultJettyHttpBinding DEBUG - HTTP
responseCode: 404
As you can see in the logs "bold" section it is making a http request to
https//url.... instead of https:// Why is this happening ? Am i missing
some configuration.
Also i know that i can use http producer directly but the reason i am using
jetty component is because i want to control the chunking of responses [ i
need it to be off], and jetty component gives an easy configuration for
that.
TIA
--
View this message in context: http://camel.465427.n5.nabble.com/Using-jetty-component-for-http-producer-Weird-behavior-tp5733303.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Using jetty component for http producer : Weird behavior
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Follow the advice on this page
http://camel.apache.org/support
On Wed, Jun 5, 2013 at 7:02 AM, anand_tech <an...@gmail.com> wrote:
> Someone, any pointers over here ??
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Using-jetty-component-for-http-producer-Weird-behavior-tp5733303p5733833.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: Using jetty component for http producer : Weird behavior
Posted by anand_tech <an...@gmail.com>.
Someone, any pointers over here ??
--
View this message in context: http://camel.465427.n5.nabble.com/Using-jetty-component-for-http-producer-Weird-behavior-tp5733303p5733833.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Using jetty component for http producer : Weird behavior
Posted by anand_tech <an...@gmail.com>.
I think there is some issue with the internal jetty http producer classes.
I changed the endpoint's name at jetty's end and gave an uri through
processor using CamelHttpUri, but it still produced same behavior.
Logs :
[2013-05-28 11:24:18,366] org.apache.camel.processor.SendProcessor DEBUG -
>>>>
*Endpoint[https://googleserver/maps/api/place/photo?bridgeEndpoint=false&throwExceptionOnFailure=false]*
Exchange[Message: [Body is null]]
[2013-05-28 11:24:18,369] org.apache.camel.component.jetty.JettyHttpProducer
DEBUG - *Sending HTTP request to:
https//maps.googleapis.com:443/maps/api/place/photo?maxwidth=80&photoreference=CnRoAAAAmGXSPqV7_E_P0o8JeCr6xXH4DLJZsm3-od2lJWVjtLGoa5pl_yDoufwBuGl1pw-3OhBxHvXLOWWJACQxuy1nJdm2uPwSVsEqPNZpml85tNfntMvQtuRb63HZybXAk5hr62Y-wvJOA2jCXVxcAOciuRIQ02-DFJ3aWT5O3HAir_DGBxoUuab9uUKGbSELn4j9-SduNVWVUwM&sensor=true&key=encrypted&client=blahblah*
[2013-05-28 11:24:18,394]
org.apache.camel.component.jetty.JettyContentExchange DEBUG - TaskComplete
with state 7 for url:
https//maps.googleapis.com:443/maps/api/place/photo?maxwidth=80&photoreference=CnRoAAAAmGXSPqV7_E_P0o8JeCr6xXH4DLJZsm3-od2lJWVjtLGoa5pl_yDoufwBuGl1pw-3OhBxHvXLOWWJACQxuy1nJdm2uPwSVsEqPNZpml85tNfntMvQtuRb63HZybXAk5hr62Y-wvJOA2jCXVxcAOciuRIQ02-DFJ3aWT5O3HAir_DGBxoUuab9uUKGbSELn4j9-SduNVWVUwM&sensor=true&key=encrypted&client=blahblaha
[2013-05-28 11:24:18,395]
org.apache.camel.component.jetty.DefaultJettyHttpBinding DEBUG - HTTP
responseCode: 404
Why does it replaces https:// with https//, or is there something else ?
--
View this message in context: http://camel.465427.n5.nabble.com/Using-jetty-component-for-http-producer-Weird-behavior-tp5733303p5733344.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Using jetty component for http producer : Weird behavior
Posted by anand_tech <an...@gmail.com>.
Camel is 2.9.0 and jetty is 7.5.3. Jetty jars are downloaded as part of
camel-jetty dependencies through maven, so i guess jetty's version should
not be a problem.
--
View this message in context: http://camel.465427.n5.nabble.com/Using-jetty-component-for-http-producer-Weird-behavior-tp5733303p5733321.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Using jetty component for http producer : Weird behavior
Posted by Claus Ibsen <cl...@gmail.com>.
What version of Camel and Jetty are you using?
On Tue, May 28, 2013 at 9:34 AM, anand_tech <an...@gmail.com> wrote:
> i tried putting port also explicitly, but no luck .. Any pointers here ?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Using-jetty-component-for-http-producer-Weird-behavior-tp5733303p5733317.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: Using jetty component for http producer : Weird behavior
Posted by anand_tech <an...@gmail.com>.
i tried putting port also explicitly, but no luck .. Any pointers here ?
--
View this message in context: http://camel.465427.n5.nabble.com/Using-jetty-component-for-http-producer-Weird-behavior-tp5733303p5733317.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Using jetty component for http producer : Weird behavior
Posted by anand_tech <an...@gmail.com>.
Could it be that i haven't mentioned the port explicitly in the endpoint ??
"jetty://https://maps.googleapis.com{: is port needed here ?}/....
--
View this message in context: http://camel.465427.n5.nabble.com/Using-jetty-component-for-http-producer-Weird-behavior-tp5733303p5733309.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Using jetty component for http producer : Weird behavior
Posted by anand_tech <an...@gmail.com>.
Oh, i should have mentioned that too. I have already tried it with
"jetty:https://maps.google....
--
View this message in context: http://camel.465427.n5.nabble.com/Using-jetty-component-for-http-producer-Weird-behavior-tp5733303p5733307.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Using jetty component for http producer : Weird behavior
Posted by Claus Ibsen <cl...@gmail.com>.
Try with jetty:https://xxxxx
On Tue, May 28, 2013 at 8:01 AM, anand_tech <an...@gmail.com> wrote:
> Hi,
>
> I have a route like this in Java DSL
>
> from("servlet://abc/?matchOnUriPrefix=true")
> .process(new Processor()
> {
>
> @Override
> public void process(Exchange arg0) throws Exception
> {
> Message inMessage = arg0.getIn();
> String query = inMessage.getHeader(Exchange.HTTP_QUERY, String.class);
> query+="&key="+"encrypted";
> query+="&client="+"blahblah";
> inMessage.setHeader(Exchange.HTTP_QUERY, query);
>
> }
> })
>
> .to(ExchangePattern.InOut,
> "jetty://https://maps.googleapis.com/maps/api/place/photo?bridgeEndpoint=true&throwExceptionOnFailure=false&chunked=false")
>
>
> The problem is that when jetty component sends http request it skips ":"
> character after https. Here are my logs:
>
> [2013-05-27 16:17:45,591] org.apache.camel.component.jetty.JettyHttpProducer
> DEBUG - Starting producer:
> Producer[https://maps.googleapis.com/maps/api/place/photo?bridgeEndpoint=true&throwExceptionOnFailure=false]
> [2013-05-27 16:17:45,592] org.apache.camel.impl.ProducerCache DEBUG - Adding
> to producer cache with key:
> Endpoint[https://maps.googleapis.com/maps/api/place/photo?bridgeEndpoint=true&throwExceptionOnFailure=false]
> for producer:
> Producer[https://maps.googleapis.com/maps/api/place/photo?bridgeEndpoint=true&throwExceptionOnFailure=false]
> [2013-05-27 16:17:45,593] org.apache.camel.processor.SendProcessor DEBUG -
>>>>>
> Endpoint[https://maps.googleapis.com/maps/api/place/photo?bridgeEndpoint=true&throwExceptionOnFailure=false]
> Exchange[Message: [Body is null]]
> [2013-05-27 16:17:45,599] org.apache.camel.component.jetty.JettyHttpProducer
> DEBUG - *Sending HTTP request to:
> https//maps.googleapis.com:443/maps/api/place/photo?chunked=false&maxwidth=80&photoreference=CnRwAAAAw2ZAy_2j-1qX0acePL_UPebtDtA7O6fFFsjX6tWn0gTWy_iKos50DnznRrjSuZeW90iYcyWYNLwnvpUAVWrdiGYL5HDPKODUFNvmR6jY9lMBRhtXSeTOGRnS3TIOqWDw3uw94gmCcPG-7iyMiPvHtRIQzOy5YEYPCjRjbjDXzCiTLRoUMG3S9rfMT-J0er4bLon_rSqQ_WQ&sensor=true&key=encrypted&client=blahblah*
> [2013-05-27 16:17:45,750]
> org.apache.camel.component.jetty.JettyContentExchange DEBUG - TaskComplete
> with state 7 for url:
> https//maps.googleapis.com:443/maps/api/place/photo?chunked=false&maxwidth=80&photoreference=CnRwAAAAw2ZAy_2j-1qX0acePL_UPebtDtA7O6fFFsjX6tWn0gTWy_iKos50DnznRrjSuZeW90iYcyWYNLwnvpUAVWrdiGYL5HDPKODUFNvmR6jY9lMBRhtXSeTOGRnS3TIOqWDw3uw94gmCcPG-7iyMiPvHtRIQzOy5YEYPCjRjbjDXzCiTLRoUMG3S9rfMT-J0er4bLon_rSqQ_WQ&sensor=true&key=encrypted&client=blahblah
> [2013-05-27 16:17:45,750]
> org.apache.camel.component.jetty.DefaultJettyHttpBinding DEBUG - HTTP
> responseCode: 404
>
> As you can see in the logs "bold" section it is making a http request to
> https//url.... instead of https:// Why is this happening ? Am i missing
> some configuration.
>
> Also i know that i can use http producer directly but the reason i am using
> jetty component is because i want to control the chunking of responses [ i
> need it to be off], and jetty component gives an easy configuration for
> that.
> TIA
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Using-jetty-component-for-http-producer-Weird-behavior-tp5733303.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen