Hi,
If you check the Java doc of the JettyHttpBinding, you will find it is
just used for JettyHttpProducer.
Your test case just showed it.
But for your real use case, you need to extends the DefaultHttpBinding
which will be used in the JettyHttpConsumer.
Please update the HttpBinding attribute of the JettyHttpComponent with
your customer HttpBinding.
On Sat Apr 28 01:07:18 2012, Chris Odom wrote:
First off thanks for your reply and I am using a vanilla install of
apache-servicemix-4.4.1-fuse-03-06. What didn't happen was in the original
email in the 'Spring config' below you should have seen my configuration of
the JettyHttpComponent with jettyHttpBinding.
Spring config:
<bean id="jetty"
class="org.apache.camel.component.jetty.JettyHttpComponent">
<property name="sslSocketConnectorProperties">
<map>
<entry key="password"
value="${com.cvs.rxdw.emh.http.sslPassword}"/>
<entry key="keyPassword"
value="${com.cvs.rxdw.emh.http.sslKeyPassword}"/>
<entry key="keystore"
value="file:${com.cvs.rxdw.emh.http.keystore}"/>
</map>
</property>
<property name="httpClientMinThreads"
value="${com.cvs.rxdw.emh.http.httpClientMinThreads}"/>
<property name="httpClientMaxThreads"
value="${com.cvs.rxdw.emh.http.httpClientMaxThreads}"/>
<property name="jettyHttpBinding" ref="httpResponseBinding"/>
</bean>
<bean id="httpResponseBinding"
class="com.cvs.rxdw.emh.binding.HttpResponseBinding">
<property name="transferException" value="true"/>
<property name="throwExceptionOnFailure" value="true"/>
</bean>
Is this configuration I just inject the bean value into the Component.
Upon debugging the value is set and seems to be init'd correctly.
I have tried to create a URI based on the the jettyHttpBindingRef as well
and get the exact same initialization as doing it above.
Spring config:
<bean id="httpReqResRoute" class="com.cvs.rxdw.emh.route.HttpReqResRoute">
<property name="acceptURL"
value="jetty:https://${com.some.servername}:${com.some.port}?jettyHttpBindingRef=httpResponseBinding&matchOnUriPrefix=true"
/>
<property name="queueName" value="${com.cvs.rxdw.emh.jms.queueName}"
/>
</bean>
If I create a camel support test that directly uses the endpoint on a
producer template, so something like:
Object result =
template.requestBody("jetty:https://someserver:someport/",
getSampleMessage("Request.xml"));
the binding works.
If I deploy this code into a Servicemix container where Camel actually
stands up a Servlet, CamelContinuationServlet, the binding references can
be found on the endpoint on the Camel HttpConsumer but it never gets
called. I did some digging into this continuation pattern and the Camel
code that it represents to see that there is really no code that tries to
use the Camel HttpConsumer to call the bindings. Not really sure why this
happens but it makes since why the camel endpoint component tests are
passing but in a real scenario where Camel front ends the component with
this CamelContinuationServlet nothing happens.
--
Willem
----------------------------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang