Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-9525

Post method doesn't work on restlet component on Karaf


    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • fuse-7.2
    • fuse-7.0
    • Camel
    • None
    • % %
    • Fuse 7.2 Sprint 35

      I have this reproducer, which send POST request. Consumer should receive some message, but it doesn't.

      		<restConfiguration component="restlet" host="localhost" port="9080" />
      			<from uri="timer:x?repeatCount=1&amp;delay=5000" />
      				<constant>Hello world</constant>
      			<log message="body to send: ${body}" />
      			<to uri="rest://POST:/services:/contact-service/user" />
      			<from uri="restlet:http://localhost:9080/services/contact-service/user?restletMethods=POST" />
      			<log message="Request body: ${body} but should be Hello world" />

      Problem you can see here: https://github.com/apache/camel/blob/c69affc49415b190645ce25536ffd62348c4fe34/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/DefaultRestletBinding.java#L290

      Instead of == should be used .equals(). Because Karaf and its class loader makes that request.getMethod() and Method.POST IDs are different.

            acosenti Andrea Cosentino
            tveskrna Tomas Veskrna
            Tomas Veskrna Tomas Veskrna
            0 Vote for this issue
            2 Start watching this issue