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

Post method doesn't work on restlet component on Karaf

XMLWordPrintable

    • 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" />
      		<route>
      			<from uri="timer:x?repeatCount=1&amp;delay=5000" />
      			<setBody>
      				<constant>Hello world</constant>
      			</setBody>
      			<log message="body to send: ${body}" />
      			<to uri="rest://POST:/services:/contact-service/user" />
      		</route>
      
      		<route>
      			<from uri="restlet:http://localhost:9080/services/contact-service/user?restletMethods=POST" />
      			<log message="Request body: ${body} but should be Hello world" />
      		</route>
      

      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
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: