camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cappa Roberto <>
Subject R: R: Dynamically change HTTP endpoint parameters
Date Mon, 19 Jul 2010 08:34:32 GMT
Hi, thanks for the solution.

A last question:

I've tryed with the 2.5-SNAPSHOT and it works, also if I don't create a new HTTP component
from code, but only using a different http url dynamically loaded with recipientList. This
is the code:

        .process(new Processor() {
            public void process(Exchange exc) throws Exception {
                String username = ((HttpServletRequest)exc.getIn().getBody(HttpServletRequest.class)).getParameter("username");
                String password = ((HttpServletRequest)exc.getIn().getBody(HttpServletRequest.class)).getParameter("password");
               //Setting final endpoint with dynamic proxy username/password, read from user
+ password);

The question is: does it work also in case of concurrent requests? I've the suspect that in
this case there is only one http component, reconfigured at runtime. Is this solution safe
in concurrent case? Or is it preferrable to create new "httpX" components with a progressive
'X' in each call, in order to avoid the reuse of the same component?


Da: Willem Jiang []
Inviato: sabato 17 luglio 2010 13.15
A: Willem Jiang
Oggetto: Re: R: Dynamically change HTTP endpoint parameters

FYI,the patch of CAMEL-2950 is applied into camel trunk, please check
out the latest Camel 2.5-SNAPSHOT to verify the fix :)

  Apache Camel, Apache CXF committer
  Open Source Integration

Willem Jiang wrote:
> Yes, they are the same problem.
> Current camel-http component can't deal with the address part rightly.
> It should skip the URI which protocal part is not start with http: or
> https, in this way we could register a customer protocal name for it.
> I just create a JIRA[1] for it.
> [1]
> Willem
> ----------------------------------
> Apache Camel, Apache CXF committer
> Open SOA
> Blog
> Tiwtter
> Cappa Roberto wrote:
>> The two versions:
>> HttpComponent httpComponent = new HttpComponent();
>>         getContext().addComponent("http2", httpComponent);
>> or
>> getContext().addComponent("http2", getContext().getComponent("http"));
>> have the same behaviour when the endpoint is used (the  "unsupported
>> protocol: 'http2'" exception). Probably there is another problem.
>> Thanks

View raw message