On 11/9/10 5:42 PM, unmarshall wrote:
Hi Willem,
Did not know about the CxfHeaderFilterStrategy. How do you use it?
You can set your customer HeaderFilterStrategy directly from the URI
like this
.to("cxf:bean:orderProcessingEndpoint?headerFilterStrategy=#YourHeaderFilterStrategy");
You need to add below line into your spring configuration
<bean id="YourHeaderFilterStrategy" class="YourHeaderFilterStrategy" />
The route is rather simple:
from("cxf:bean:entryEndpoint")
.convertBodyTo(String.class)
.enrich("direct:A", new MessageConcatenator("MultiMessage",
"http://www.example.com/cmservices"))
.enrich("direct:B", new MessageConcatenator("MultiMessage",
"http://www.example.com/cmservices"))
.to("xslt:final.xslt");
from("direct:A")
.to("xslt:a.xslt")
.process(new CustomProcessor())
.to("cxf:bean:orderProcessingEndpoint); // This is an externally hosted
service
Best Regards,
Madhav
unmarshall wrote:
Hi Willem,
Apologies for a late response. It was festive season here and therefore a
delay.
The problem is solved when i set the chunking threshold as:
<http-conf:conduit name="*.http-conduit">
<http-conf:client ChunkingThreshold="50" />
</http-conf:conduit>
By default AllowChunking is true and you do not have to set it. Even if
you set it to false it will not change the request header if the
Transfer-Encoding header is already present.
The problem is surely in CXF but i was hoping that the CXF-Camel component
can re-use HttpHeaderFilterStrategy to filter out common headers.
This solution looks more like a hack. Ideally CXF should take care of
checking for certain headers and then club it together with its logic for
automatically enabling chunking beyond a certain threshold.
Best Regards,
Madhav
Willem.Jiang wrote:
Hi Madhav,
Can I have a look at your route?
I think the Transfer-Encoding = chunked value can be filtered by a
customer CxfHeaderFilterStrategy.
How about just add this configuration ?
<http-conf:conduit name="*.http-conduit">
<http-conf:client AllowChunking="true"/>
</http-conf:conduit>
Now I need to check the CXF code to see if I can let the http conduit
just send the chucked request if the protocol header is
"Transfer-Encoding = chunked".
On 11/4/10 12:33 AM, unmarshall wrote:
Hi All,
I got this working. The problem is that CXF is not smart enough to
determine
that there is a Transfer-Encoding = chunked being set by the server (in
my
case it was tomcat). It defines a threshold value below which it will
not
chunk the body and only if the the size is above the threshold it will
chunk
it.
The problem is that when it decides not to chunk it does not chunk the
payload but the it does not remove the header. So when the request goes
to
the server it sees that the chunked transfer-encoding has been set but
the
CXF did not chunk the request. So the server throws an exception saying
its
an invalid chunk header.
In Camel HTTP component this has been taken care by having a
HttpHeaderFilterStrategy and therefore this does not happen if camel
http
endpoints are used instead of CXF.
This in my opinion is a BUG.
The workaround is that the threshold should be set to a very low value
so it
chunks almost all requests.
Best Regards,
Madhav
unmarshall wrote:
Hi All,
I am using Camel 2.5. I need to disable chunking and for that i have
configured the following:
<http-conf:conduit name="*.http-conduit">
<http-conf:client AllowChunking="false"/>
</http-conf:conduit>
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang